Search code examples
windowscmd

How to run cmd as admin? But in command line


I'm looking for a way to be able to open cmd as admin with code. So like linux. We just execute "sudo su" command for be admin. But ı want this for windows. So ı want execute a command in cmd like "sudo su" and be admin. How can ı do this?


Solution

  • You should run:

    runas /user:administrator cmd
    

    then enter the administrator password.