views:

84

answers:

1

Hi, I'm trying to install some files from a batch file (through code). However the command should only run as "elevated command" in Vista and Windows 7 Is there any way this can be done programitically?

I'm launching the batch file by calling "CreateProcess" in VC++/MFC code.

Thanks

+1  A: 
ShellExecute(NULL, L"runas", ...);

For whatever reason the "runas" verb isn't documented in MSDN but...

Larry Osterman
Thanks the above solution fixed my problem!
mots_g