Thursday, November 15, 2007

CreateProcessAsUser

Some times we need to spawn a child process. The trick however being it has to be execute with some different user account. This situation can arise in some ASP.Net applications as well.

It is not always possible to have the password of the user account under which we want to spawn the process.
In such cases .Net's standard System.diagnostics.Process.Start doesn't work.

Here comes WIN32 for our help.

CreateProcessAsUser Win32 API is most suitable for such situations.
Following are the links where this scenario is very well explained.

http://support.microsoft.com/default.aspx?scid=kb;EN-US;889251

http://odetocode.com/Blogs/scott/archive/2004/10/28/602.aspx


Thanks
Prasad Pimparkar

No comments: