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