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.
 
Gus said:
Please could you give me more details about that way of doing that..?
check msdn for the two function, and make DLLImport like pinvoke
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top