views:

457

answers:

1

In a batch file you can use %PROGRAMFILES% to get the location of the program files directory, how do you do it in a VBScript?

+4  A: 
Set wshShell = CreateObject("WScript.Shell")
WScript.Echo wshShell.ExpandEnvironmentStrings("%PROGRAMFILES%")
Jonas Elfström
Nice, thanks. I have been resorting to reading the registry, but your answer is far better. Thanks.
Jeremy