Run .bat as admin
Solved
MakaKiller
Posted messages
54
Status
Member
-
MakaKiller Posted messages 54 Status Member -
MakaKiller Posted messages 54 Status Member -
Hello,
I want to launch a .bat script in a session that does not have admin rights,
my script contains this:
When I run this .bat, it does prompt for the Administrator user's password but opens a new command prompt and does not continue executing the commands.
I would therefore like to be able to execute these commands requiring admin rights.
P.S.: ipconfig is just an example; I can already hear the "ipconfig doesn't require elevation" comments.
Configuration: Windows 7 / Chrome 49.0.2623.112
I want to launch a .bat script in a session that does not have admin rights,
my script contains this:
runas /noprofile /user:hostname\Administrator cmd
ipconfig
When I run this .bat, it does prompt for the Administrator user's password but opens a new command prompt and does not continue executing the commands.
I would therefore like to be able to execute these commands requiring admin rights.
P.S.: ipconfig is just an example; I can already hear the "ipconfig doesn't require elevation" comments.
Configuration: Windows 7 / Chrome 49.0.2623.112