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