code_junkie

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

Nov 13th, 2011
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. WCHAR szNativeProgramFilesFolder[MAX_PATH];
  2. ExpandEnvironmentStrings(L"%ProgramW6432%", szNativeProgramFilesFolder, ARRAYSIZE(szNativeProgramFilesFolder);
  3.  
  4. Dim oWshShell : Set oWshShell = CreateObject("WScript.Shell")
  5. Dim sProgramDirPath : sProgramDirPath =
  6. oWshShell.ExpandEnvironmentStrings("%ProgramW6432%")
  7.  
  8. WScript.Echo sProgramDirPath
Add Comment
Please, Sign In to add comment