To run an application as a different user you must us CreateProcessWithLogonW
http://msdn.microsoft.com/
Main Topics
Browse All TopicsHello all
I'm trying to register my COM server programatically from c++ code using standard c function system (const char*), or alternatively any of the _exec* function family. It works fine under XP systems, however on Vista, it doesn't register the COM server. When I try to register my COM server directly from cmd ([serverpath] /regserver), I get no error at all, but the registration is not made. However, when I execute cmd.exe using the "Run as administrator" option, the registration succeeds.
My question is: How can I register my COM server on vista machines from the c++ code (perhaps using one of the _exec* functions with some special parameters)?
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
To run an application as a different user you must us CreateProcessWithLogonW
http://msdn.microsoft.com/
Always start the application which registers com server through 'run as administrator'. The parent process's privilege will be elevated to child process as well.
If you wish to register through command prompt try start the command prompt [through shortcut?] through 'run as administrator' and then register com server. Also, you can use 'runas' command with desired user name details for registering your com server.
John Nash.
You don't need to launch any external applications, just use the code presented at http://support.microsoft.c
I'd recomment http:#25106090 - since to me it seems the simplest way to address this problem, without asking the user for an admin password.
Business Accounts
Answer for Membership
by: fridomPosted on 2009-03-17 at 23:54:19ID: 23916065
Maybe you can make use of: p/misc/mis c/system/a rticle.php / c3805
http://www.codeguru.com/Cp
Regards
Friedrich