How to get Program Files folder path (not Program Files (x86)) from 32bit WOW process?

前端 未结 6 2373
我寻月下人不归
我寻月下人不归 2021-02-19 05:42

I need to get the path to the native (rather than the WOW) program files directory from a 32bit WOW process.

When I pass CSIDL_PROGRAM_FILES (or CSIDL_PROGRAM_FILESX86)

6条回答
  •  执笔经年
    2021-02-19 06:11

    I needed it to get the x64 Program Folder from a Logonscript and used:

    Dim oWshShell : Set oWshShell = CreateObject("WScript.Shell")
    Dim sProgramDirPath : sProgramDirPath = 
        oWshShell.ExpandEnvironmentStrings("%ProgramW6432%")
    
    WScript.Echo sProgramDirPath
    

提交回复
热议问题