I'm actually looking for a way to run the batch file as admin by using a code. If that is not possible is there any way to run an .exe file as admin by default?
Asked
Active
Viewed 107 times
0
-
No. If there was, it would be a pretty significant security hole. Even when logged in as an administrator, things that require admin privileges don't execute without permission being explicitly granted; this includes batch files, where you have to use *Run as administrator* when opening the command prompt to execute them or run them from Explorer. – Ken White Apr 02 '16 at 14:37
-
@KenWhite Yes, now i realize that. Thanks buddy. – Aryan Apr 02 '16 at 15:12
-
1http://superuser.com/a/852877 – Mark Setchell Apr 02 '16 at 18:55
-
3Possible duplicate of [How to request Administrator access inside a batch file](http://stackoverflow.com/questions/1894967/how-to-request-administrator-access-inside-a-batch-file) – JosefZ Apr 02 '16 at 19:00
-
@JosefZ, please flag this as duplicate. I already did. – manjesh23 Apr 03 '16 at 04:11
-
@manjesh23 my comment was generated automatically from _casting_, see [Cast Close And Reopen Votes](http://stackoverflow.com/help/privileges/close-questions) privilege. No need to flag; _flagging_ would be superabundant action… – JosefZ Apr 03 '16 at 07:14