开发者

How to get program files environment setting from VBScript

开发者 https://www.devze.com 2022-12-14 07:10 出处:网络
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\")

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

精彩评论

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