Process.Start() error: The specified executable is not a valid Win32 application


  • My code is
    Process prc = new Process();
    prc.StartInfo.FileName = "excuteFile.exe";
    prc.StartInfo.Arguments = input + " " + output;
    prc.StartInfo.CreateNoWindow = true;
    prc.StartInfo.UseShellExecute = false;
    prc.StartInfo.RedirectStandardOutput = true;
    File arguments: excuteFile.exe input.txt output.txt
    My system: Windows 7 Home Premium Edition 64 bits.
    Error: The specified executable is not a valid Win32 application.
    IDE: Visual Studio 2008 Team System.
    It had been run successfully, but since 12 hours ago, when I run it, the error appeared. I read these URL and followed the steps, but, the problem is not solved.
    Mittwoch, 7. Dezember 2011 04:01


Alle Antworten

  • Try either of below ways

    1. Build your project in x86 mode. You can do it in project properties.


    2. I think "excuteFile" application uses native 32 bit instructions. So, build "excuteFile" using x86 configuration.

    Please mark this post as answer if it solved your problem. Happy Programming!
    Mittwoch, 7. Dezember 2011 06:22
  • What if you specify the full path to excuteFile.exe, and double check that it exists on disk first?
    Mittwoch, 7. Dezember 2011 18:46
  • Thanks everyone!


    I solved the problem. Just overwrite copy the executeFile.exe, it had been error.

    Donnerstag, 8. Dezember 2011 01:41
  • Thanks for sharing your solution here.

    And thanks for your understanding and support.

    Best Regards,
    Rocky Yue[MSFT]
    MSDN Community Support | Feedback to us
    Donnerstag, 8. Dezember 2011 08:32