How to get program files environment setting from

2020-04-07 02:47发布

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?

2条回答
爱情/是我丢掉的垃圾
2楼-- · 2020-04-07 03:21
Set wshShell = CreateObject("WScript.Shell")
WScript.Echo wshShell.ExpandEnvironmentStrings("%PROGRAMFILES%")
查看更多
孤傲高冷的网名
3楼-- · 2020-04-07 03:22

To get Program Files (x86) use:

Set wshShell = CreateObject("WScript.Shell")
WScript.Echo wshShell.ExpandEnvironmentStrings("%PROGRAMFILES(x86)%")
查看更多
登录 后发表回答