Start Process with different user

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi:

I know that it is possible to run an application using System.Diagnostics,
for example:

System.Diagnostics.Process.Start("iexplore");

This will start internet explorer in name of the current logged user. My
question is: How can I specify a different user, supposing that I know his
username and password?

Is it possible? I think it is... but how?

Thanks
 
Gus said:
Hi:

I know that it is possible to run an application using System.Diagnostics,
for example:

System.Diagnostics.Process.Start("iexplore");

This will start internet explorer in name of the current logged user. My
question is: How can I specify a different user, supposing that I know his
username and password?

Is it possible? I think it is... but how?

Thanks

There is no "managed" way to do this in v1.x of the framework. You will have
to PInvoke CreateProcessWithLogonW when running XP or higher, or LogonUser
and CreateProcessAsUser on lower OS.

WillY.
 
Back
Top