System32 folder in windows 7

Phoenix picture Phoenix · Sep 4, 2010 · Viewed 8.3k times · Source

I'm using this code in XP 32-bit OS to get the %windir%\windows\system32 folder path.

sysFolderPath = Environment.GetFolderPath(Environment.SpecialFolder.System)

What I want to know is that will this same code return the %windir%\windows\syswow64 folder when used in Windows 7 (64/32-bit)?

Answer

Hans Passant picture Hans Passant · Sep 4, 2010

It will return c:\windows\system32, even in a 32-bit program that runs on the 64-bit version of Windows. Do not fix this, it doesn't need fixing. Because when you use that path, Windows will automatically remap it to c:\windows\syswow64. The file system redirector takes care of it.