process.start() program hangs

A

Alexander Widera

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
 
B

bruce barker \(sqlwork.com\)

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"
 
A

Alexander Widera

it is a console application.



bruce barker (sqlwork.com) said:
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"
 
A

Alvin Bruney

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
 
A

Alexander Widera

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 said:
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"
I need still help!


"Alexander Widera"
 
A

Alexander Widera

no ideas?

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

alex



"Alexander Widera"
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 said:
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"
I need still help!


"Alexander Widera"
im Newsbeitrag it is a console application.



"bruce barker (sqlwork.com)" <[email protected]>
schrieb im Newsbeitrag 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"
in message 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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top