process.start() program hangs

Discussion in 'ASP .Net' started by Alexander Widera, May 22, 2006.

  1. 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.UserName 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.exe" .. this also "hangs".

    here is my code:
    p.StartInfo.FileName = @"c:\myprog.exe";
    p.StartInfo.Arguments = "myArguments";
    p.StartInfo.UserName = @"Administrator";
    System.Security.SecureString ss = new System.Security.SecureString();
    ss.AppendChar('M');
    ss.AppendChar('Y');
    ss.AppendChar('P');
    ss.AppendChar('W');
    p.StartInfo.Password = ss;
    p.StartInfo.UseShellExecute = false;
    p.StartInfo.RedirectStandardError = true;
    p.StartInfo.RedirectStandardOutput = true;
    p.StartInfo.CreateNoWindow = true;
    p.Start();
    p.WaitForExit();

    thanks in advance,

    alex
     
    Alexander Widera, May 22, 2006
    #1
    1. Advertising

  2. 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"
    <-chemnitz.de-novaliddomainpleasedeletethispart.de> wrote in
    message news:uy$...
    > 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.UserName 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.exe" .. this also "hangs".
    >
    > here is my code:
    > p.StartInfo.FileName = @"c:\myprog.exe";
    > p.StartInfo.Arguments = "myArguments";
    > p.StartInfo.UserName = @"Administrator";
    > System.Security.SecureString ss = new System.Security.SecureString();
    > ss.AppendChar('M');
    > ss.AppendChar('Y');
    > ss.AppendChar('P');
    > ss.AppendChar('W');
    > p.StartInfo.Password = ss;
    > p.StartInfo.UseShellExecute = false;
    > p.StartInfo.RedirectStandardError = true;
    > p.StartInfo.RedirectStandardOutput = true;
    > p.StartInfo.CreateNoWindow = true;
    > p.Start();
    > p.WaitForExit();
    >
    > thanks in advance,
    >
    > alex
    >
     
    bruce barker \(sqlwork.com\), May 22, 2006
    #2
    1. Advertising

  3. it is a console application.



    "bruce barker (sqlwork.com)" <>
    schrieb im Newsbeitrag news:...
    > 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"
    > <-chemnitz.de-novaliddomainpleasedeletethispart.de> wrote in
    > message news:uy$...
    >> 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.UserName 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.exe" .. this also "hangs".
    >>
    >> here is my code:
    >> p.StartInfo.FileName = @"c:\myprog.exe";
    >> p.StartInfo.Arguments = "myArguments";
    >> p.StartInfo.UserName = @"Administrator";
    >> System.Security.SecureString ss = new System.Security.SecureString();
    >> ss.AppendChar('M');
    >> ss.AppendChar('Y');
    >> ss.AppendChar('P');
    >> ss.AppendChar('W');
    >> p.StartInfo.Password = ss;
    >> p.StartInfo.UseShellExecute = false;
    >> p.StartInfo.RedirectStandardError = true;
    >> p.StartInfo.RedirectStandardOutput = true;
    >> p.StartInfo.CreateNoWindow = true;
    >> p.Start();
    >> p.WaitForExit();
    >>
    >> thanks in advance,
    >>
    >> alex
    >>

    >
    >
     
    Alexander Widera, May 22, 2006
    #3
  4. I need still help!


    "Alexander Widera"
    <-chemnitz.de-novaliddomainpleasedeletethispart.de> schrieb im
    Newsbeitrag news:...
    > it is a console application.
    >
    >
    >
    > "bruce barker (sqlwork.com)" <>
    > schrieb im Newsbeitrag news:...
    >> 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"
    >> <-chemnitz.de-novaliddomainpleasedeletethispart.de> wrote in
    >> message news:uy$...
    >>> 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.UserName 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.exe" .. this also "hangs".
    >>>
    >>> here is my code:
    >>> p.StartInfo.FileName = @"c:\myprog.exe";
    >>> p.StartInfo.Arguments = "myArguments";
    >>> p.StartInfo.UserName = @"Administrator";
    >>> System.Security.SecureString ss = new System.Security.SecureString();
    >>> ss.AppendChar('M');
    >>> ss.AppendChar('Y');
    >>> ss.AppendChar('P');
    >>> ss.AppendChar('W');
    >>> p.StartInfo.Password = ss;
    >>> p.StartInfo.UseShellExecute = false;
    >>> p.StartInfo.RedirectStandardError = true;
    >>> p.StartInfo.RedirectStandardOutput = true;
    >>> p.StartInfo.CreateNoWindow = true;
    >>> p.Start();
    >>> p.WaitForExit();
    >>>
    >>> thanks in advance,
    >>>
    >>> alex
    >>>

    >>
    >>

    >
    >
     
    Alexander Widera, May 29, 2006
    #4
  5. Alexander Widera

    Alvin Bruney Guest

    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"
    <-chemnitz.de-novaliddomainpleasedeletethispart.de> wrote in
    message news:%...
    >I need still help!
    >
    >
    > "Alexander Widera"
    > <-chemnitz.de-novaliddomainpleasedeletethispart.de> schrieb im
    > Newsbeitrag news:...
    >> it is a console application.
    >>
    >>
    >>
    >> "bruce barker (sqlwork.com)" <>
    >> schrieb im Newsbeitrag news:...
    >>> 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"
    >>> <-chemnitz.de-novaliddomainpleasedeletethispart.de> wrote in
    >>> message news:uy$...
    >>>> 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.UserName 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.exe" .. this also "hangs".
    >>>>
    >>>> here is my code:
    >>>> p.StartInfo.FileName = @"c:\myprog.exe";
    >>>> p.StartInfo.Arguments = "myArguments";
    >>>> p.StartInfo.UserName = @"Administrator";
    >>>> System.Security.SecureString ss = new System.Security.SecureString();
    >>>> ss.AppendChar('M');
    >>>> ss.AppendChar('Y');
    >>>> ss.AppendChar('P');
    >>>> ss.AppendChar('W');
    >>>> p.StartInfo.Password = ss;
    >>>> p.StartInfo.UseShellExecute = false;
    >>>> p.StartInfo.RedirectStandardError = true;
    >>>> p.StartInfo.RedirectStandardOutput = true;
    >>>> p.StartInfo.CreateNoWindow = true;
    >>>> p.Start();
    >>>> p.WaitForExit();
    >>>>
    >>>> thanks in advance,
    >>>>
    >>>> alex
    >>>>
    >>>
    >>>

    >>
    >>

    >
    >
     
    Alvin Bruney, May 29, 2006
    #5
  6. 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$...
    > 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"
    > <-chemnitz.de-novaliddomainpleasedeletethispart.de> wrote in
    > message news:%...
    >>I need still help!
    >>
    >>
    >> "Alexander Widera"
    >> <-chemnitz.de-novaliddomainpleasedeletethispart.de> schrieb im
    >> Newsbeitrag news:...
    >>> it is a console application.
    >>>
    >>>
    >>>
    >>> "bruce barker (sqlwork.com)" <>
    >>> schrieb im Newsbeitrag news:...
    >>>> 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"
    >>>> <-chemnitz.de-novaliddomainpleasedeletethispart.de> wrote in
    >>>> message news:uy$...
    >>>>> 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.UserName 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.exe" .. this also "hangs".
    >>>>>
    >>>>> here is my code:
    >>>>> p.StartInfo.FileName = @"c:\myprog.exe";
    >>>>> p.StartInfo.Arguments = "myArguments";
    >>>>> p.StartInfo.UserName = @"Administrator";
    >>>>> System.Security.SecureString ss = new System.Security.SecureString();
    >>>>> ss.AppendChar('M');
    >>>>> ss.AppendChar('Y');
    >>>>> ss.AppendChar('P');
    >>>>> ss.AppendChar('W');
    >>>>> p.StartInfo.Password = ss;
    >>>>> p.StartInfo.UseShellExecute = false;
    >>>>> p.StartInfo.RedirectStandardError = true;
    >>>>> p.StartInfo.RedirectStandardOutput = true;
    >>>>> p.StartInfo.CreateNoWindow = true;
    >>>>> p.Start();
    >>>>> p.WaitForExit();
    >>>>>
    >>>>> thanks in advance,
    >>>>>
    >>>>> alex
    >>>>>
    >>>>
    >>>>
    >>>
    >>>

    >>
    >>

    >
    >
     
    Alexander Widera, May 30, 2006
    #6
  7. no ideas?

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

    alex



    "Alexander Widera"
    <-chemnitz.de-novaliddomainpleasedeletethispart.de> schrieb im
    Newsbeitrag news:...
    > 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$...
    >> 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"
    >> <-chemnitz.de-novaliddomainpleasedeletethispart.de> wrote in
    >> message news:%...
    >>>I need still help!
    >>>
    >>>
    >>> "Alexander Widera"
    >>> <-chemnitz.de-novaliddomainpleasedeletethispart.de> schrieb
    >>> im Newsbeitrag news:...
    >>>> it is a console application.
    >>>>
    >>>>
    >>>>
    >>>> "bruce barker (sqlwork.com)" <>
    >>>> schrieb im Newsbeitrag news:...
    >>>>> 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"
    >>>>> <-chemnitz.de-novaliddomainpleasedeletethispart.de> wrote
    >>>>> in message news:uy$...
    >>>>>> 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.UserName 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.exe" .. this also "hangs".
    >>>>>>
    >>>>>> here is my code:
    >>>>>> p.StartInfo.FileName = @"c:\myprog.exe";
    >>>>>> p.StartInfo.Arguments = "myArguments";
    >>>>>> p.StartInfo.UserName = @"Administrator";
    >>>>>> System.Security.SecureString ss = new System.Security.SecureString();
    >>>>>> ss.AppendChar('M');
    >>>>>> ss.AppendChar('Y');
    >>>>>> ss.AppendChar('P');
    >>>>>> ss.AppendChar('W');
    >>>>>> p.StartInfo.Password = ss;
    >>>>>> p.StartInfo.UseShellExecute = false;
    >>>>>> p.StartInfo.RedirectStandardError = true;
    >>>>>> p.StartInfo.RedirectStandardOutput = true;
    >>>>>> p.StartInfo.CreateNoWindow = true;
    >>>>>> p.Start();
    >>>>>> p.WaitForExit();
    >>>>>>
    >>>>>> thanks in advance,
    >>>>>>
    >>>>>> alex
    >>>>>>
    >>>>>
    >>>>>
    >>>>
    >>>>
    >>>
    >>>

    >>
    >>

    >
    >
     
    Alexander Widera, May 31, 2006
    #7
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. chad
    Replies:
    1
    Views:
    3,737
  2. Earl Eiland
    Replies:
    0
    Views:
    343
    Earl Eiland
    Mar 18, 2005
  3. Earl Eiland
    Replies:
    0
    Views:
    390
    Earl Eiland
    Mar 19, 2005
  4. Replies:
    7
    Views:
    930
    John Saunders
    Mar 20, 2007
  5. Tim Shadel

    Gem hangs => TCPSocket.write hangs

    Tim Shadel, Jul 23, 2005, in forum: Ruby
    Replies:
    1
    Views:
    425
    Ville Mattila
    Jul 24, 2005
Loading...

Share This Page