Process.Start in C# The system cannot find the file specified error

Most likely your app is 32-bit, and in 64-bit Windows references to C:\Windows\System32 get transparently redirected to C:\Windows\SysWOW64 for 32-bit apps. calc.exe happens to exist in both places, while soundrecorder.exe exists in the true System32 only.

When you launch from Start / Run the parent process is the 64-bit explorer.exe so no redirection is done, and the 64-bit C:\Windows\System32\soundrecorder.exe is found and started.

From File System Redirector:

In most cases, whenever a 32-bit application attempts to access %windir%\System32, the access is redirected to %windir%\SysWOW64.


[ EDIT ] From the same page:

32-bit applications can access the native system directory by substituting %windir%\Sysnative for %windir%\System32.

So the following would work to start soundrecorder.exe from the (real) C:\Windows\System32.

psStartInfo.FileName = @"C:\Windows\Sysnative\soundrecorder.exe";

Leave a Comment