How to Run(launch) elevated command prompt programmatically in Vista

喜你入骨 提交于 2019-12-08 07:09:02

问题


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:


ShellExecute(NULL, L"runas", ...);

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



来源:https://stackoverflow.com/questions/1797695/how-to-runlaunch-elevated-command-prompt-programmatically-in-vista

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!