Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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).

like image 777
Mark Avatar asked Oct 15 '12 20:10

Mark


People also ask

How do I enable Run as another user?

Summary. A Windows user can run a program or application as a different user. To do this, the user selects the Run as different user context menu command (or uses the Runas.exe command-line tool), and then specifies the credentials of an alternate account.


1 Answers

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 
like image 198
Herms Avatar answered Oct 22 '22 11:10

Herms