I am creating a program that has to work with Windows system programs like a C:\windows\System32\bcdedit.exe
. If I try to reach for example mspaint
it works good.
IO.File.Exists(@"C:\windows\System32\mspaint.exe") // return true
but
IO.File.Exists(@"C:\windows\System32\bcdedit.exe") // return false
This returns false but the file really exists. I can see it in windows explorer and I can start it from the command line. Only for my c# application is this file unreachable. When I want to start it I get the error Win32Exception with the message:
The system cannot find the file specified
And when I "ask" if the file exists (by code above) it returns false.
Why?