By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
464,443 Members | 1,004 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 464,443 IT Pros & Developers. It's quick & easy.

Launching unmanaged code as another user

P: n/a
I need to launch an app from inside my VB.NET app as a
specific user.

I do (VB.NET pseudo code)
Dim moImpersonationContext As WindowsImpersonationContext
= WindowsIdentityIwant.impersonate()
Shell('cmd /C TheCommandToLaunchTheUnmanagedCode')

I can verify that the Shell command runs under the new
Windows Identity, but the unmanaged code still launched
under the logged on user.

What am I doing wrong?
Jul 19 '05 #1
Share this Question
Share on Google+
1 Reply

P: n/a
Hello Greg,

Thanks for your post. I suggest that you can use P/Invoke to call
CreateProcessAsUser directly to launch an app as a specific user. Please
refer to the following MSDN articles:

Consuming Unmanaged DLL Functions


Hope this helps.


Microsoft Online Partner Support

Get Secure! C
This posting is provided as is with no warranties and confers no rights.

Jul 19 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.