Run system as administrator

How can I run a command with the system function as administrator ?

 
  system("command") // want to run command as administrator 
How do you normally gain administrative privileges in your operating system?
I usually run command promt as administrator but I can't run certain commands

with the system function because it's not as administrator.

Do you know how I could achieve this ?

Thanks
Last edited on
The "as Admin" is broad. Surely the Windows API offers a selection of fine-tuned privileges to precisely define what the application can and cannot do:
https://msdn.microsoft.com/en-us/library/windows/desktop/ee663293%28v=vs.85%29.aspx
Topic archived. No new replies allowed.