How to use runas command in windows 2008 r2 server?

10,828

Your results aren't what I expected, either. But I've got a few workarounds to suggest.

  • You could turn off User Account Control.
  • You could go to Start --> All Programs --> Accessories, then right-click on "Command Prompt" and choose "Run as Administrator."
  • You could right-click on your batch script and do the same.
  • You could create a shortcut to either cmd or your batch script on your Desktop, then modify the properties of that shortcut to run as Administrator.
  • You could add some code to your batch script to check for admin privileges and prompt for escalation if needed.

Turning off UAC would be my choice.

Share:
10,828
Bala
Author by

Bala

Updated on June 14, 2022

Comments

  • Bala
    Bala almost 2 years

    I have written a batch file which will call another batch file and delete some files. For this I need to have admin rights. I tried following command...

    runas /user:bala@nsc cmd
    Enter the password for bala@nsc: xxxxxxx
    

    Even though bala@nsc has admin rights command prompt is getting opened as a simple user rather than administrator.

    I guess, I am missing something. Please help me.