Run CMD as administrator

scr1b3

Posts: 20   +0
Is there a way to always run COMMAND PROMPT in administrator mode? I'm using windows XP Pro.

What I want to do is launch CMD in ADMINISTRATOR mode and restart a few machines using 'shutdown -r ' command. The only way I can do that is if CMD is in ADMINISTRATOR MODE.

My current batch file looks like this at the moment but it does not work.

runas /user:administrator cmd
shutdown -m \\pcsample -r

This doesnt work because the second command does does not get inserted into the second CMD (administrator mode).
 
put the shutdown -m \\pcsample -r into a foo.bat file

now RUNAS /user;admin foo.bat
 
Go to Start > Accessories > right click on Command Prompt and select "Run As..." Select "the following user" and "Administrator".
 
Back