Source language: Translate to:

Get Program Files path

Questions and information about using VBScript and JavaScript in NeoBook functions

Moderator: Neosoft Support

Get Program Files path

Postby smokinbanger » Thu Mar 08, 2012 10:10 am

How do I get the Special Folders "Program Files" path with vbscript?
I'm trying to use this code but I think I'm missing something:
Code: Select all
Dim WSHShell
Set WSHShell = CreateObject("WScript.Shell")

Dim ProgramFiles

' Read proram files path using WshSpecialFolders object
ProgramFiles = WSHShell.SpecialFolders("Program Files")

'send the results to a NeoBook variable
publication.nbSetVar "[%ProgramFiles]", ProgramFiles

Also does it work with most versions of windows (XP, Vista, Win7)?
smokinbanger
 
Posts: 198
Joined: Mon Jan 16, 2012 9:53 am
Location: United States

Postby HPW » Thu Mar 08, 2012 10:34 am

What about predefined var [ProgramFiles]?
Hans-Peter
User avatar
HPW
 
Posts: 2519
Joined: Fri Apr 01, 2005 11:24 pm
Location: Germany

Postby smokinbanger » Thu Mar 08, 2012 4:29 pm

HPW wrote:What about predefined var [ProgramFiles]?

Oops! I forgot about that! I think I need to get out and get some fresh air!
smokinbanger
 
Posts: 198
Joined: Mon Jan 16, 2012 9:53 am
Location: United States


Return to NeoBook Functions - VBScript & JavaScript

Who is online

Users browsing this forum: No registered users and 2 guests