Process.Start with Username and Password, misbehaving?  
Author Message
WhiteAndNerdy





PostPosted: .NET Base Class Library, Process.Start with Username and Password, misbehaving? Top

Evenin' all,

After a bit of playing around with System.Diagnostics.Process, i found i can specify a username and password to run a shell command, which is great.

However, me thinks when i run .Start() it just runs RunAs, so therefore i cant read the StandardOutput stream, as there isn't anything.

Basically the way i think it works is, .Start() executes the RunAs command in the Shell, which then logs in as the specified user and executes the command, but in a new shell, which i cant read...

Is there any way around this

Thanks guys,

Dean



.NET Development31  
 
 
WhiteAndNerdy





PostPosted: .NET Base Class Library, Process.Start with Username and Password, misbehaving? Top

Not to worry guys, the workaround is to make a new app pool with the specified user that i wanted which has the correct permissions :)