How do I run a program from command prompt as a different user and as an admin

Mark picture Mark · Oct 15, 2012 · Viewed 271.6k times · Source

I am using "runas" to open command prompt as a different user but that command prompt is not running as an admin. How can I make it run as an admin?

UPDATE: I am using Windows Server 2012

UPDATE: I opened cmd for another account by running

 runas /user:domain\username cmd.exe

Then I tried to run some commands in this new prompt but this is not running as an elevated user (even though it has Administrator privileges).

Answer

Herms picture Herms · Oct 15, 2012

See here: https://superuser.com/questions/42537/is-there-any-sudo-command-for-windows

According to that the command looks like this for admin:

 runas /noprofile /user:Administrator cmd