I’m trying to find a file inside the system directory.
The problem is that when using
Environment.SystemDirectory
On a x64 machine, i’m still getting the System32 directory, instead of the Systemwow64 directory.
I need to get the “System32” directory on x86 machines, and “SystemWow64” directory on x64
Any ideas?
EDIT:
To find the SysWow64 i’m using the “GetSystemWow64Directory”. (more information here: pinvoke
Notice that on non-x64 machines – result is ‘0’.
Hope this helps someone
Using the
SHGetSpecialFolderPathfunction:Will return
System32on x86, andSysWow64on x64