Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Run process as different user

Status
Not open for further replies.

tmcnutt

Programmer
May 17, 2002
83
US
I am trying to run a process with administrator privileges, but having no success. I am using impersonation, which shows that the current identity is that of the administrator account. What I am trying to do is run a .cmd file on either the local machine or on a network share. The problem is when I use System.Diagnostics.Process.Start("c:\batch\test.cmd") the command prompt window flashes real quick and I can't see what the error is. I run the same .cmd file right before I do impersonation and it works fine. It is a test file that pauses the command prompt window. I am not sure how the System.Diagnostics.Process.Start handles running under the impersonated user so that's where I need some help. I would like to have the .cmd run from a network share, but command windows says it doesn't support unc paths. The original users has a mapped drive, but the impersonated user account doesn't. Any help is greatly appreciated.

Thanks,
Tom
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top