There are times when you do want to run a command on Windows, such as for example a powershell window with elevated privileges. There may also be a reason that you want to run the command as an administrative user that is not named ‘Administrator’.

You can do this by spawning a non-privileged powershell window first. From there enter the command below, and, after entering your password, you should have an administrative terminal.

PS C:\Users\you> runas /user:theAdminUsername powershell

This way you can spawn a “root” Terminal in Windows as you would do with e.g. sudo su - on a Linux machine.

Like this post? Share on: TwitterFacebookEmail


Jens Frey Avatar Jens Frey is the creator of the datapile blog.

Keep Reading


Published

Category

Fundamentals

Tags

Stay in Touch