开发者

Process.Start dirquota.exe - The system cannot find the file specified

开发者 https://www.devze.com 2023-01-15 06:24 出处:网络
Banging my head against the wall for around 2 days with this one. I am using a System.Diagnostics.Process to execute dirquota.exe. I catch an exception at .Start() which is \"The system cannot find t

Banging my head against the wall for around 2 days with this one.

I am using a System.Diagnostics.Process to execute dirquota.exe. I catch an exception at .Start() which is "The system cannot find the file specified".

I am now doing:

            foreach (var fi in new DirectoryInfo(@"C:\W开发者_Python百科indows\System32\").GetFiles())
            {
                Console.WriteLine(fi.Name);
            }

This outputs pretty much every file in that directory apart from dirquota.exe. Anyone?

Cheers.


Are you running on a 64-bit version of Windows? Look in c:\windows\syswow64, home of the 32-bit programs.


I just hit this same error and the issue was that the executable program was compiled as x86 and running it in a 64 bit OS.

Changing the project 'Platform Target' to AnyCPU fixes it.

0

精彩评论

暂无评论...
验证码 换一张
取 消