process.start() program hangs

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Alexander Widera

    process.start() program hangs

    hello,

    if i start a program (an exe-file) with Process.Start(. ..) I don't have the
    required permissions that the programm needs (i could start the programm but
    the program needs special rights). So I added the StartInfo.UserN ame and
    Password to the Process. Now the program starts, but it hangs... nothing
    happens. In the task-manager the process is created, but it doesn't do
    anything - no cpu-load and no change of memory-usage.

    What could be the problem? Why hangs the programm? I've tried also an other
    programm e.g. "notepad.ex e" .. this also "hangs".

    here is my code:
    p.StartInfo.Fil eName = @"c:\myprog.exe ";
    p.StartInfo.Arg uments = "myArgument s";
    p.StartInfo.Use rName = @"Administrator ";
    System.Security .SecureString ss = new System.Security .SecureString() ;
    ss.AppendChar(' M');
    ss.AppendChar(' Y');
    ss.AppendChar(' P');
    ss.AppendChar(' W');
    p.StartInfo.Pas sword = ss;
    p.StartInfo.Use ShellExecute = false;
    p.StartInfo.Red irectStandardEr ror = true;
    p.StartInfo.Red irectStandardOu tput = true;
    p.StartInfo.Cre ateNoWindow = true;
    p.Start();
    p.WaitForExit() ;

    thanks in advance,

    alex


  • bruce barker \(sqlwork.com\)

    #2
    Re: process.start() program hangs

    most likely the exe uses a window, and just hangs if it can not create one
    (say notepad.exe). you can only run console apps from asp.net.

    -- bruce (sqlwork.com)


    "Alexander Widera"
    <awid@hrz.tu-chemnitz.de-novaliddomainpl easedeletethisp art.de> wrote in
    message news:uy$hFrcfGH A.2188@TK2MSFTN GP05.phx.gbl...[color=blue]
    > hello,
    >
    > if i start a program (an exe-file) with Process.Start(. ..) I don't have
    > the required permissions that the programm needs (i could start the
    > programm but the program needs special rights). So I added the
    > StartInfo.UserN ame and Password to the Process. Now the program starts,
    > but it hangs... nothing happens. In the task-manager the process is
    > created, but it doesn't do anything - no cpu-load and no change of
    > memory-usage.
    >
    > What could be the problem? Why hangs the programm? I've tried also an
    > other programm e.g. "notepad.ex e" .. this also "hangs".
    >
    > here is my code:
    > p.StartInfo.Fil eName = @"c:\myprog.exe ";
    > p.StartInfo.Arg uments = "myArgument s";
    > p.StartInfo.Use rName = @"Administrator ";
    > System.Security .SecureString ss = new System.Security .SecureString() ;
    > ss.AppendChar(' M');
    > ss.AppendChar(' Y');
    > ss.AppendChar(' P');
    > ss.AppendChar(' W');
    > p.StartInfo.Pas sword = ss;
    > p.StartInfo.Use ShellExecute = false;
    > p.StartInfo.Red irectStandardEr ror = true;
    > p.StartInfo.Red irectStandardOu tput = true;
    > p.StartInfo.Cre ateNoWindow = true;
    > p.Start();
    > p.WaitForExit() ;
    >
    > thanks in advance,
    >
    > alex
    >[/color]


    Comment

    • Alexander Widera

      #3
      Re: process.start() program hangs

      it is a console application.



      "bruce barker (sqlwork.com)" <b_r_u_c_e_remo veunderscores@s qlwork.com>
      schrieb im Newsbeitrag news:Or1WCgdfGH A.2188@TK2MSFTN GP05.phx.gbl...[color=blue]
      > most likely the exe uses a window, and just hangs if it can not create one
      > (say notepad.exe). you can only run console apps from asp.net.
      >
      > -- bruce (sqlwork.com)
      >
      >
      > "Alexander Widera"
      > <awid@hrz.tu-chemnitz.de-novaliddomainpl easedeletethisp art.de> wrote in
      > message news:uy$hFrcfGH A.2188@TK2MSFTN GP05.phx.gbl...[color=green]
      >> hello,
      >>
      >> if i start a program (an exe-file) with Process.Start(. ..) I don't have
      >> the required permissions that the programm needs (i could start the
      >> programm but the program needs special rights). So I added the
      >> StartInfo.UserN ame and Password to the Process. Now the program starts,
      >> but it hangs... nothing happens. In the task-manager the process is
      >> created, but it doesn't do anything - no cpu-load and no change of
      >> memory-usage.
      >>
      >> What could be the problem? Why hangs the programm? I've tried also an
      >> other programm e.g. "notepad.ex e" .. this also "hangs".
      >>
      >> here is my code:
      >> p.StartInfo.Fil eName = @"c:\myprog.exe ";
      >> p.StartInfo.Arg uments = "myArgument s";
      >> p.StartInfo.Use rName = @"Administrator ";
      >> System.Security .SecureString ss = new System.Security .SecureString() ;
      >> ss.AppendChar(' M');
      >> ss.AppendChar(' Y');
      >> ss.AppendChar(' P');
      >> ss.AppendChar(' W');
      >> p.StartInfo.Pas sword = ss;
      >> p.StartInfo.Use ShellExecute = false;
      >> p.StartInfo.Red irectStandardEr ror = true;
      >> p.StartInfo.Red irectStandardOu tput = true;
      >> p.StartInfo.Cre ateNoWindow = true;
      >> p.Start();
      >> p.WaitForExit() ;
      >>
      >> thanks in advance,
      >>
      >> alex
      >>[/color]
      >
      >[/color]


      Comment

      • Alexander Widera

        #4
        Re: process.start() program hangs

        I need still help!


        "Alexander Widera"
        <awid@hrz.tu-chemnitz.de-novaliddomainpl easedeletethisp art.de> schrieb im
        Newsbeitrag news:eI1lGSefGH A.5096@TK2MSFTN GP02.phx.gbl...[color=blue]
        > it is a console application.
        >
        >
        >
        > "bruce barker (sqlwork.com)" <b_r_u_c_e_remo veunderscores@s qlwork.com>
        > schrieb im Newsbeitrag news:Or1WCgdfGH A.2188@TK2MSFTN GP05.phx.gbl...[color=green]
        >> most likely the exe uses a window, and just hangs if it can not create
        >> one (say notepad.exe). you can only run console apps from asp.net.
        >>
        >> -- bruce (sqlwork.com)
        >>
        >>
        >> "Alexander Widera"
        >> <awid@hrz.tu-chemnitz.de-novaliddomainpl easedeletethisp art.de> wrote in
        >> message news:uy$hFrcfGH A.2188@TK2MSFTN GP05.phx.gbl...[color=darkred]
        >>> hello,
        >>>
        >>> if i start a program (an exe-file) with Process.Start(. ..) I don't have
        >>> the required permissions that the programm needs (i could start the
        >>> programm but the program needs special rights). So I added the
        >>> StartInfo.UserN ame and Password to the Process. Now the program starts,
        >>> but it hangs... nothing happens. In the task-manager the process is
        >>> created, but it doesn't do anything - no cpu-load and no change of
        >>> memory-usage.
        >>>
        >>> What could be the problem? Why hangs the programm? I've tried also an
        >>> other programm e.g. "notepad.ex e" .. this also "hangs".
        >>>
        >>> here is my code:
        >>> p.StartInfo.Fil eName = @"c:\myprog.exe ";
        >>> p.StartInfo.Arg uments = "myArgument s";
        >>> p.StartInfo.Use rName = @"Administrator ";
        >>> System.Security .SecureString ss = new System.Security .SecureString() ;
        >>> ss.AppendChar(' M');
        >>> ss.AppendChar(' Y');
        >>> ss.AppendChar(' P');
        >>> ss.AppendChar(' W');
        >>> p.StartInfo.Pas sword = ss;
        >>> p.StartInfo.Use ShellExecute = false;
        >>> p.StartInfo.Red irectStandardEr ror = true;
        >>> p.StartInfo.Red irectStandardOu tput = true;
        >>> p.StartInfo.Cre ateNoWindow = true;
        >>> p.Start();
        >>> p.WaitForExit() ;
        >>>
        >>> thanks in advance,
        >>>
        >>> alex
        >>>[/color]
        >>
        >>[/color]
        >
        >[/color]


        Comment

        • Alvin Bruney

          #5
          Re: process.start() program hangs

          What does this process do? Can you run it manually? does it require user
          input? Have you followed the suggestions listed provided?

          --

          _______________ _________
          Warm regards,
          Alvin Bruney [MVP ASP.NET]

          [Shameless Author plug]
          Professional VSTO.NET - Wrox/Wiley
          The O.W.C. Black Book with .NET
          www.lulu.com/owc, Amazon
          Blog: http://www.msmvps.com/blogs/alvin
          -------------------------------------------------------

          "Alexander Widera"
          <awid@hrz.tu-chemnitz.de-novaliddomainpl easedeletethisp art.de> wrote in
          message news:%23BuUwJug GHA.4708@TK2MSF TNGP04.phx.gbl. ..[color=blue]
          >I need still help!
          >
          >
          > "Alexander Widera"
          > <awid@hrz.tu-chemnitz.de-novaliddomainpl easedeletethisp art.de> schrieb im
          > Newsbeitrag news:eI1lGSefGH A.5096@TK2MSFTN GP02.phx.gbl...[color=green]
          >> it is a console application.
          >>
          >>
          >>
          >> "bruce barker (sqlwork.com)" <b_r_u_c_e_remo veunderscores@s qlwork.com>
          >> schrieb im Newsbeitrag news:Or1WCgdfGH A.2188@TK2MSFTN GP05.phx.gbl...[color=darkred]
          >>> most likely the exe uses a window, and just hangs if it can not create
          >>> one (say notepad.exe). you can only run console apps from asp.net.
          >>>
          >>> -- bruce (sqlwork.com)
          >>>
          >>>
          >>> "Alexander Widera"
          >>> <awid@hrz.tu-chemnitz.de-novaliddomainpl easedeletethisp art.de> wrote in
          >>> message news:uy$hFrcfGH A.2188@TK2MSFTN GP05.phx.gbl...
          >>>> hello,
          >>>>
          >>>> if i start a program (an exe-file) with Process.Start(. ..) I don't have
          >>>> the required permissions that the programm needs (i could start the
          >>>> programm but the program needs special rights). So I added the
          >>>> StartInfo.UserN ame and Password to the Process. Now the program starts,
          >>>> but it hangs... nothing happens. In the task-manager the process is
          >>>> created, but it doesn't do anything - no cpu-load and no change of
          >>>> memory-usage.
          >>>>
          >>>> What could be the problem? Why hangs the programm? I've tried also an
          >>>> other programm e.g. "notepad.ex e" .. this also "hangs".
          >>>>
          >>>> here is my code:
          >>>> p.StartInfo.Fil eName = @"c:\myprog.exe ";
          >>>> p.StartInfo.Arg uments = "myArgument s";
          >>>> p.StartInfo.Use rName = @"Administrator ";
          >>>> System.Security .SecureString ss = new System.Security .SecureString() ;
          >>>> ss.AppendChar(' M');
          >>>> ss.AppendChar(' Y');
          >>>> ss.AppendChar(' P');
          >>>> ss.AppendChar(' W');
          >>>> p.StartInfo.Pas sword = ss;
          >>>> p.StartInfo.Use ShellExecute = false;
          >>>> p.StartInfo.Red irectStandardEr ror = true;
          >>>> p.StartInfo.Red irectStandardOu tput = true;
          >>>> p.StartInfo.Cre ateNoWindow = true;
          >>>> p.Start();
          >>>> p.WaitForExit() ;
          >>>>
          >>>> thanks in advance,
          >>>>
          >>>> alex
          >>>>
          >>>
          >>>[/color]
          >>
          >>[/color]
          >
          >[/color]


          Comment

          • Alexander Widera

            #6
            Re: process.start() program hangs

            hi,
            the application i want to start is "svn.exe" (Subversion - perhaps you know)
            .... If I run it without setting a username and password it starts, but then
            it hasn't enough rights to fullfill its task and it gives an error message.
            and when i start it with an username and passoword it "hangs". It does
            nothing... no error message .. nothing ... it simply hangs and is in the
            taskmanger visible. .. with constant ram-usage and no cpu-activity.

            what could that be?

            alex



            "Alvin Bruney" <www.lulu.com/owc> schrieb im Newsbeitrag
            news:OV6Bz$xgGH A.1520@TK2MSFTN GP03.phx.gbl...[color=blue]
            > What does this process do? Can you run it manually? does it require user
            > input? Have you followed the suggestions listed provided?
            >
            > --
            >
            > _______________ _________
            > Warm regards,
            > Alvin Bruney [MVP ASP.NET]
            >
            > [Shameless Author plug]
            > Professional VSTO.NET - Wrox/Wiley
            > The O.W.C. Black Book with .NET
            > www.lulu.com/owc, Amazon
            > Blog: http://www.msmvps.com/blogs/alvin
            > -------------------------------------------------------
            >
            > "Alexander Widera"
            > <awid@hrz.tu-chemnitz.de-novaliddomainpl easedeletethisp art.de> wrote in
            > message news:%23BuUwJug GHA.4708@TK2MSF TNGP04.phx.gbl. ..[color=green]
            >>I need still help!
            >>
            >>
            >> "Alexander Widera"
            >> <awid@hrz.tu-chemnitz.de-novaliddomainpl easedeletethisp art.de> schrieb im
            >> Newsbeitrag news:eI1lGSefGH A.5096@TK2MSFTN GP02.phx.gbl...[color=darkred]
            >>> it is a console application.
            >>>
            >>>
            >>>
            >>> "bruce barker (sqlwork.com)" <b_r_u_c_e_remo veunderscores@s qlwork.com>
            >>> schrieb im Newsbeitrag news:Or1WCgdfGH A.2188@TK2MSFTN GP05.phx.gbl...
            >>>> most likely the exe uses a window, and just hangs if it can not create
            >>>> one (say notepad.exe). you can only run console apps from asp.net.
            >>>>
            >>>> -- bruce (sqlwork.com)
            >>>>
            >>>>
            >>>> "Alexander Widera"
            >>>> <awid@hrz.tu-chemnitz.de-novaliddomainpl easedeletethisp art.de> wrote in
            >>>> message news:uy$hFrcfGH A.2188@TK2MSFTN GP05.phx.gbl...
            >>>>> hello,
            >>>>>
            >>>>> if i start a program (an exe-file) with Process.Start(. ..) I don't
            >>>>> have the required permissions that the programm needs (i could start
            >>>>> the programm but the program needs special rights). So I added the
            >>>>> StartInfo.UserN ame and Password to the Process. Now the program
            >>>>> starts, but it hangs... nothing happens. In the task-manager the
            >>>>> process is created, but it doesn't do anything - no cpu-load and no
            >>>>> change of memory-usage.
            >>>>>
            >>>>> What could be the problem? Why hangs the programm? I've tried also an
            >>>>> other programm e.g. "notepad.ex e" .. this also "hangs".
            >>>>>
            >>>>> here is my code:
            >>>>> p.StartInfo.Fil eName = @"c:\myprog.exe ";
            >>>>> p.StartInfo.Arg uments = "myArgument s";
            >>>>> p.StartInfo.Use rName = @"Administrator ";
            >>>>> System.Security .SecureString ss = new System.Security .SecureString() ;
            >>>>> ss.AppendChar(' M');
            >>>>> ss.AppendChar(' Y');
            >>>>> ss.AppendChar(' P');
            >>>>> ss.AppendChar(' W');
            >>>>> p.StartInfo.Pas sword = ss;
            >>>>> p.StartInfo.Use ShellExecute = false;
            >>>>> p.StartInfo.Red irectStandardEr ror = true;
            >>>>> p.StartInfo.Red irectStandardOu tput = true;
            >>>>> p.StartInfo.Cre ateNoWindow = true;
            >>>>> p.Start();
            >>>>> p.WaitForExit() ;
            >>>>>
            >>>>> thanks in advance,
            >>>>>
            >>>>> alex
            >>>>>
            >>>>
            >>>>
            >>>
            >>>[/color]
            >>
            >>[/color]
            >
            >[/color]


            Comment

            • Alexander Widera

              #7
              Re: process.start() program hangs

              no ideas?

              how do you start an application with other userrights? perhaps i missed
              something.

              alex



              "Alexander Widera"
              <awid@hrz.tu-chemnitz.de-novaliddomainpl easedeletethisp art.de> schrieb im
              Newsbeitrag news:OZPP8pAhGH A.4776@TK2MSFTN GP05.phx.gbl...[color=blue]
              > hi,
              > the application i want to start is "svn.exe" (Subversion - perhaps you
              > know) ... If I run it without setting a username and password it starts,
              > but then it hasn't enough rights to fullfill its task and it gives an
              > error message.
              > and when i start it with an username and passoword it "hangs". It does
              > nothing... no error message .. nothing ... it simply hangs and is in the
              > taskmanger visible. .. with constant ram-usage and no cpu-activity.
              >
              > what could that be?
              >
              > alex
              >
              >
              >
              > "Alvin Bruney" <www.lulu.com/owc> schrieb im Newsbeitrag
              > news:OV6Bz$xgGH A.1520@TK2MSFTN GP03.phx.gbl...[color=green]
              >> What does this process do? Can you run it manually? does it require user
              >> input? Have you followed the suggestions listed provided?
              >>
              >> --
              >>
              >> _______________ _________
              >> Warm regards,
              >> Alvin Bruney [MVP ASP.NET]
              >>
              >> [Shameless Author plug]
              >> Professional VSTO.NET - Wrox/Wiley
              >> The O.W.C. Black Book with .NET
              >> www.lulu.com/owc, Amazon
              >> Blog: http://www.msmvps.com/blogs/alvin
              >> -------------------------------------------------------
              >>
              >> "Alexander Widera"
              >> <awid@hrz.tu-chemnitz.de-novaliddomainpl easedeletethisp art.de> wrote in
              >> message news:%23BuUwJug GHA.4708@TK2MSF TNGP04.phx.gbl. ..[color=darkred]
              >>>I need still help!
              >>>
              >>>
              >>> "Alexander Widera"
              >>> <awid@hrz.tu-chemnitz.de-novaliddomainpl easedeletethisp art.de> schrieb
              >>> im Newsbeitrag news:eI1lGSefGH A.5096@TK2MSFTN GP02.phx.gbl...
              >>>> it is a console application.
              >>>>
              >>>>
              >>>>
              >>>> "bruce barker (sqlwork.com)" <b_r_u_c_e_remo veunderscores@s qlwork.com>
              >>>> schrieb im Newsbeitrag news:Or1WCgdfGH A.2188@TK2MSFTN GP05.phx.gbl...
              >>>>> most likely the exe uses a window, and just hangs if it can not create
              >>>>> one (say notepad.exe). you can only run console apps from asp.net.
              >>>>>
              >>>>> -- bruce (sqlwork.com)
              >>>>>
              >>>>>
              >>>>> "Alexander Widera"
              >>>>> <awid@hrz.tu-chemnitz.de-novaliddomainpl easedeletethisp art.de> wrote
              >>>>> in message news:uy$hFrcfGH A.2188@TK2MSFTN GP05.phx.gbl...
              >>>>>> hello,
              >>>>>>
              >>>>>> if i start a program (an exe-file) with Process.Start(. ..) I don't
              >>>>>> have the required permissions that the programm needs (i could start
              >>>>>> the programm but the program needs special rights). So I added the
              >>>>>> StartInfo.UserN ame and Password to the Process. Now the program
              >>>>>> starts, but it hangs... nothing happens. In the task-manager the
              >>>>>> process is created, but it doesn't do anything - no cpu-load and no
              >>>>>> change of memory-usage.
              >>>>>>
              >>>>>> What could be the problem? Why hangs the programm? I've tried also an
              >>>>>> other programm e.g. "notepad.ex e" .. this also "hangs".
              >>>>>>
              >>>>>> here is my code:
              >>>>>> p.StartInfo.Fil eName = @"c:\myprog.exe ";
              >>>>>> p.StartInfo.Arg uments = "myArgument s";
              >>>>>> p.StartInfo.Use rName = @"Administrator ";
              >>>>>> System.Security .SecureString ss = new System.Security .SecureString() ;
              >>>>>> ss.AppendChar(' M');
              >>>>>> ss.AppendChar(' Y');
              >>>>>> ss.AppendChar(' P');
              >>>>>> ss.AppendChar(' W');
              >>>>>> p.StartInfo.Pas sword = ss;
              >>>>>> p.StartInfo.Use ShellExecute = false;
              >>>>>> p.StartInfo.Red irectStandardEr ror = true;
              >>>>>> p.StartInfo.Red irectStandardOu tput = true;
              >>>>>> p.StartInfo.Cre ateNoWindow = true;
              >>>>>> p.Start();
              >>>>>> p.WaitForExit() ;
              >>>>>>
              >>>>>> thanks in advance,
              >>>>>>
              >>>>>> alex
              >>>>>>
              >>>>>
              >>>>>
              >>>>
              >>>>
              >>>
              >>>[/color]
              >>
              >>[/color]
              >
              >[/color]


              Comment

              Working...