Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7851569
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T19:12:54+00:00 2026-06-02T19:12:54+00:00

This is boggling my mind. Using the following code: Process du = new Process();

  • 0

This is boggling my mind. Using the following code:

Process du = new Process();          

string cmdPath = System.IO.Path.Combine(Environment.SystemDirectory, "du.exe");
Debug.WriteLine(cmdPath);

ProcessStartInfo info = new ProcessStartInfo(cmdPath);
info.CreateNoWindow = true;

info.Arguments = arguments;            
info.UseShellExecute = false;

info.RedirectStandardOutput = true;
du.StartInfo = info;
du.EnableRaisingEvents = true;
du.OutputDataReceived += responseParser;

du.Start();
du.BeginOutputReadLine();
du.WaitForExit();

I run that, and I get:

Unhandled Exception: System.ComponentModel.Win32Exception: The system cannot find the file specified

though the output value of cmdPath is C:\Windows\system32\du.exe!

and of course, if I just type the contents of cmdPath into a command prompt, it runs du.exe and gives me the usage info.

Also, if I replace the command path with just “du.exe”, and put the du.exe in the working directory, all works fine. But I want to reference the one in the system location.

So, what is going on? As far as I can tell, I have a legitimate file specifier, but why won’t Process.Start() execute it? This basic code is also executing several other programs and getting their output. The others all work fine, though du.exe is different from them in that it’s in the system32 directory. Does that have something to do with it?

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T19:12:55+00:00Added an answer on June 2, 2026 at 7:12 pm

    This is down to the file system redirector. You will be running a 32 bit process on a 64 bit machine. That means that C:\Windows\system32 is transparently redirected to C:\Windows\SysWOW64 and I expect that du.exe cannot be found there. If you use C:\Windows\Sysnative instead then you will be able to locate the file.

    However, I suspect that you have added du.exe to the system directory since this is not a standard Windows component. You should not do that. I recommend you put the file somewhere else because you simply should not be writing in the system directory.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Why does System.Xml.XmlDocument.LoadXml method throw System.Net.WebException ? This is really mind boggling crazy, if
My php is a little rusty but this is boggling my mind right now.
This code fails when I try to debug it using VC2010: char frd[32]=word-list.txt; FILE
This is an example of the code am using. I use a modified version
This is mind-boggling... I can make getResource() and getResourceAsStream() work properly when I run
I'm trying to get my head round this mind boggling stuff they call Database
This is something that's been mind boggling to me for a while, some times
This is my code: OleDbConnection connection = new OleDbConnection( Provider=Microsoft.ACE.OLEDB.12.0;Data Source=c:\\Offline.accdb;Persist Security Info=False); connection.Open();
I am not sure how to phrase this as it is boggling my mind.
It seems like this should be straightforward but I'm boggling. I've got my listview

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.