In a batch file you can use %PRO开发者_C百科GRAMFILES% to get the location of the program files directory, how do you do it in a VBScript?
Set wshShell = CreateObject("WScript.Shell")
WScript.Echo wshShell.ExpandEnvironmentStrings("%PROGRAMFILES%")
To get Program Files (x86) use:
Set wshShell = CreateObject("WScript.Shell")
WScript.Echo wshShell.ExpandEnvironmentStrings("%PROGRAMFILES(x86)%")
精彩评论