开发者

How to get program files environment setting from VBScript

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)%")
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜