How to get program files environment setting from VBScript

前端 未结 2 1826
臣服心动
臣服心动 2021-01-18 04:22

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条回答
  • 2021-01-18 04:55

    To get Program Files (x86) use:

    Set wshShell = CreateObject("WScript.Shell")
    WScript.Echo wshShell.ExpandEnvironmentStrings("%PROGRAMFILES(x86)%")
    
    0 讨论(0)
  • 2021-01-18 04:58
    Set wshShell = CreateObject("WScript.Shell")
    WScript.Echo wshShell.ExpandEnvironmentStrings("%PROGRAMFILES%")
    
    0 讨论(0)
提交回复
热议问题