Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

My OS is 64 bits and in the foler C:WindowsSysWOW64 there is a file 111.txt, but there is not the file in c:windowssystem32

but the follwoing code return true

file = @"C:WindowsSystem32111.txt";    
bool bExist = System.IO.File.Exists(file);

I don't know why? and how can i check if there is the file 111.txt under system32 not SysWoW64?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
307 views
Welcome To Ask or Share your Answers For Others

1 Answer

Because so many applications have hard-coded the System32 directory name into paths, MS put the 64-bit systems files there instead of in a 'System64' directory. The 32-bit versions now go into a 'SysWOW64' directory (it's quite confusing). but in order to prevent breaking 32-bit programs, the system performs a redirection by default for 32-bit processes trying to access the 'System32' directory. In most cases, whenever a 32-bit application attempts to access %windir%System32, the access is redirected to %windir%SysWOW64.

A simple way to get around this redirection is to use %windir%Sysnative instead of %windir%System32. Win64 will 'redirect' that directory to the actual System32 directory.

You can use the Wow64DisableWow64FsRedirection() API to completely disable this redirection . See http://msdn.microsoft.com/en-us/library/aa384187.aspx for details.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...