Posts: 82
Threads: 31
Joined: Oct 2007
Is there a line of code I can put in a compiled program to force it to run with Administrative privileges? Instead of having to right click on the file and "Run as Administrator" (Vista, 7), it would be nice if the file will open requesting Administrative privileges automatically.
Thanks
Posts: 12,095
Threads: 142
Joined: Dec 2002
In file or shortcut properties select Compatibility, "Run this program as administrator".
Or exe can run self as administrator, using run() function with flag 0x10000 or 0x20000.
In any case, will show consent dialog.
Posts: 82
Threads: 31
Joined: Oct 2007
I'm sorry, I still don't understand... Do I put this "run() function with flag 0x10000 or 0x20000" at the beginning of the code? As is or is there something I need to change/tweak? If so, can you give me an example please? Let's just say open Notepad with Adminstrative privileges.
Thank you
Posts: 12,095
Threads: 142
Joined: Dec 2002
Forgot it. Don't use run. Instead edit manifest file. Read more in QM help, "make exe" topic. Just replace word asInvoker to highestAvailable or requireAdministrator. More info - google.
Posts: 82
Threads: 31
Joined: Oct 2007
I will look into this. Thank you