System32 folder on Windows 7

I use this code on a 32-bit XP OS to get the path to the %windir%\windows\system32 .

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

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

+4
source share
3 answers

It will return c: \ windows \ system32 even in a 32-bit program that runs on a 64-bit version of Windows. Do not fix it; it does not need fixing. Because when you use this path, Windows will automatically reconfigure it to c: \ windows \ syswow64. a file redirector will take care of this.

+5
source

I tried my Windows7 mailbox with .NET 4.0

This code:

 Console.WriteLine(Environment.GetFolderPath(Environment.SpecialFolder.System)); Console.WriteLine(Environment.GetFolderPath(Environment.SpecialFolder.SystemX86)); 

Outputs the following data from a 32-bit and 64-bit process:

 C:\Windows\system32 C:\Windows\SysWOW64 
+1
source

Nope. In my x64-based Windows 7 64-bit field:

  C: \ Windows \ system32 
0
source

All Articles