change exe option to run as administrator by bat script on Windows 7
22,332
Solution 1
Right-click the BAT file and press Create Shortcut. The shortcut will appear. You can edit the shortcut's properties and set it to always run as administrator. Of course, you have to run the BAT file through the shortcut now.
Solution 2
I don't think it's possible in plain windows without installing an additional utility to elevate priviledges from the command line.
If you accept bundling such an utility with your bat file (or installing it system-wide), check this out: http://www.winability.com/elevate/
Related videos on Youtube
Author by
studiohack
Updated on September 18, 2022Comments
-
studiohack over 1 year
I can't disable UAC in Windows 7 and I want to change
.exe
option to run as administrator. I can right click on icon and goto compatibility then change this option through GUI but I have to do by .bat..... Can someone give me a demo .bat.-
Andriy M over 12 yearsI don't believe such a possibility is even supposed to be there in Windows 7. Elevating rights programmatically is something that Windows XP allows you to do and a thing that can potentially be (and probably is) exploited by malware. If Windows 7's UAC allowed elevating rights programmatically without user's consent, that would seem to me like stepping on the same rake.
-
Dracs over 12 yearsDo you just want to launch something from a batch script as admin. Or do you want to change the exe to always run as admin (like you can in the compatibility tab)?
-