views:

59

answers:

1

Hi,

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:\Windows\System32\").GetFiles())
            {
                Console.WriteLine(fi.Name);
            }

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

Cheers.

+3  A: 

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

Hans Passant
Hi I am looking in that folder and there is no dirquota.exe. I can definitely see this file in System32.
youwhut
Okay now I have compiled the application to target x64 everything is good. Thank you for the tip that got me thinking!
youwhut
@youwhut: be sure to use Any CPU instead.
Hans Passant