Run CMD as administrator

By scr1b3
Aug 18, 2010
Post New Reply
  1. 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).
  2. jobeard

    jobeard TS Ambassador Posts: 9,160   +599

    put the shutdown -m \\pcsample -r into a foo.bat file

    now RUNAS /user;admin foo.bat
  3. g4mer

    g4mer TS Maniac Posts: 310

    Go to Start > Accessories > right click on Command Prompt and select "Run As..." Select "the following user" and "Administrator".

Similar Topics

Add New Comment

You need to be a member to leave a comment. Join thousands of tech enthusiasts and participate.
TechSpot Account You may also...