Win32Exception at Process.Start()

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Leonel Galán

    Win32Exception at Process.Start()

    When doing Process.Start() , I get "The parameter is invalid"
    Win32Exception when opening a particular exe. This exe works good in
    Windows (cmd.exe).

    The exe is "SPIM.exe" as the Simulator for the MIPS assembling language
    (http://www.cs.wisc.edu/~larus/spim.html).

    I know that maybe that particular file has something strange, but I
    thought someone could give me some advice.

    Thanks,

  • Mark R. Dawson

    #2
    RE: Win32Exception at Process.Start()

    Hi Leonel,
    can you post complete example code so it makes your issue easier to resolve.

    Thanks
    Mark.
    --



    "Leonel Galán" wrote:
    When doing Process.Start() , I get "The parameter is invalid"
    Win32Exception when opening a particular exe. This exe works good in
    Windows (cmd.exe).
    >
    The exe is "SPIM.exe" as the Simulator for the MIPS assembling language
    (http://www.cs.wisc.edu/~larus/spim.html).
    >
    I know that maybe that particular file has something strange, but I
    thought someone could give me some advice.
    >
    Thanks,
    >
    >

    Comment

    • Dave Sexton

      #3
      Re: Win32Exception at Process.Start()

      Hi Leonel,

      It sounds to me like you're missing or have used an incorrect command-line
      argument.

      --
      Dave Sexton

      "Leonel Galán" <leonelgalan@gm ail.comwrote in message
      news:1163483507 .826370.213930@ b28g2000cwb.goo glegroups.com.. .
      When doing Process.Start() , I get "The parameter is invalid"
      Win32Exception when opening a particular exe. This exe works good in
      Windows (cmd.exe).
      >
      The exe is "SPIM.exe" as the Simulator for the MIPS assembling language
      (http://www.cs.wisc.edu/~larus/spim.html).
      >
      I know that maybe that particular file has something strange, but I
      thought someone could give me some advice.
      >
      Thanks,
      >

      Comment

      • Leonel Galán

        #4
        Re: Win32Exception at Process.Start()

        It appears that SPIM.exe is a CYGWIN application. And there is some
        trouble with that. I'm not familiar with UNIX applications or CYGWIN
        for running them on Windows, I thought it was a normal Win App. Maybe
        someone familiar with this stuff can give me some advice.

        The code it's just:

        Process p = new Process();
        p.StartInfo.Fil eName = "SPIM.exe";
        p.Start();


        Leonel Galán wrote:
        When doing Process.Start() , I get "The parameter is invalid"
        Win32Exception when opening a particular exe. This exe works good in
        Windows (cmd.exe).
        >
        The exe is "SPIM.exe" as the Simulator for the MIPS assembling language
        (http://www.cs.wisc.edu/~larus/spim.html).
        >
        I know that maybe that particular file has something strange, but I
        thought someone could give me some advice.

        Thanks,

        Comment

        • Dave Sexton

          #5
          Re: Win32Exception at Process.Start()

          Hi Leonel,

          Try setting p.StartInfo.Use ShellExecute to false.

          --
          Dave Sexton

          "Leonel Galán" <leonelgalan@gm ail.comwrote in message
          news:1163661694 .641740.76290@h 54g2000cwb.goog legroups.com...
          It appears that SPIM.exe is a CYGWIN application. And there is some
          trouble with that. I'm not familiar with UNIX applications or CYGWIN
          for running them on Windows, I thought it was a normal Win App. Maybe
          someone familiar with this stuff can give me some advice.

          The code it's just:

          Process p = new Process();
          p.StartInfo.Fil eName = "SPIM.exe";
          p.Start();


          Leonel Galán wrote:
          When doing Process.Start() , I get "The parameter is invalid"
          Win32Exception when opening a particular exe. This exe works good in
          Windows (cmd.exe).
          >
          The exe is "SPIM.exe" as the Simulator for the MIPS assembling language
          (http://www.cs.wisc.edu/~larus/spim.html).
          >
          I know that maybe that particular file has something strange, but I
          thought someone could give me some advice.
          >
          Thanks,

          Comment

          • Leonel Galán

            #6
            Re: Win32Exception at Process.Start()

            Actually I was trying to capture console output so I use that command
            and others like

            RedirectStandar dOutput = True

            But trying to make it simplier I notice that just the Start() command
            and the exception is thrown.


            Dave Sexton wrote:
            Hi Leonel,
            >
            Try setting p.StartInfo.Use ShellExecute to false.
            >
            --
            Dave Sexton
            >
            "Leonel Galán" <leonelgalan@gm ail.comwrote in message
            news:1163661694 .641740.76290@h 54g2000cwb.goog legroups.com...
            It appears that SPIM.exe is a CYGWIN application. And there is some
            trouble with that. I'm not familiar with UNIX applications or CYGWIN
            for running them on Windows, I thought it was a normal Win App. Maybe
            someone familiar with this stuff can give me some advice.
            >
            The code it's just:
            >
            Process p = new Process();
            p.StartInfo.Fil eName = "SPIM.exe";
            p.Start();
            >
            >
            Leonel Galán wrote:
            When doing Process.Start() , I get "The parameter is invalid"
            Win32Exception when opening a particular exe. This exe works good in
            Windows (cmd.exe).

            The exe is "SPIM.exe" as the Simulator for the MIPS assembling language
            (http://www.cs.wisc.edu/~larus/spim.html).

            I know that maybe that particular file has something strange, but I
            thought someone could give me some advice.

            Thanks,

            Comment

            • Dave Sexton

              #7
              Re: Win32Exception at Process.Start()

              Hi Leonel,

              Well, since you can execute it using cmd.exe (as you wrote in the OP), try the
              following:

              Process process = Process.Start(
              Environment.Exp andEnvironmentV ariables("%coms pec%"), "/C SPIM.exe");

              System.Threadin g.Thread.Sleep( 200);
              process.Close() ;

              It's not a pretty solution, however.

              If you don't have the comspec environment variable defined, then you can try
              @"%windir%\syst em32\cmd.exe" instead. In this case, you might have to specify
              the path for SPIM.exe as well.

              HTH

              (I'm running out of ideas ;)

              --
              Dave Sexton

              "Leonel Galán" <leonelgalan@gm ail.comwrote in message
              news:1163710769 .453488.187970@ i42g2000cwa.goo glegroups.com.. .
              Actually I was trying to capture console output so I use that command
              and others like

              RedirectStandar dOutput = True

              But trying to make it simplier I notice that just the Start() command
              and the exception is thrown.


              Dave Sexton wrote:
              Hi Leonel,
              >
              Try setting p.StartInfo.Use ShellExecute to false.
              >
              --
              Dave Sexton
              >
              "Leonel Galán" <leonelgalan@gm ail.comwrote in message
              news:1163661694 .641740.76290@h 54g2000cwb.goog legroups.com...
              It appears that SPIM.exe is a CYGWIN application. And there is some
              trouble with that. I'm not familiar with UNIX applications or CYGWIN
              for running them on Windows, I thought it was a normal Win App. Maybe
              someone familiar with this stuff can give me some advice.
              >
              The code it's just:
              >
              Process p = new Process();
              p.StartInfo.Fil eName = "SPIM.exe";
              p.Start();
              >
              >
              Leonel Galán wrote:
              When doing Process.Start() , I get "The parameter is invalid"
              Win32Exception when opening a particular exe. This exe works good in
              Windows (cmd.exe).

              The exe is "SPIM.exe" as the Simulator for the MIPS assembling language
              (http://www.cs.wisc.edu/~larus/spim.html).

              I know that maybe that particular file has something strange, but I
              thought someone could give me some advice.

              Thanks,

              Comment

              Working...