3

I have a windows 7 user who belongs to admin group. I want to execute sc command that requires admin privileges. I DON'T want to open an elevated cmd, want to be able to simply Win+R->Enter command, enter password and that's all. I tried the runas command, but it doesn't seem to work:

>runas /user:me "cmd"

and it asks for a password, and then the command is executed with normal privileges. I know I could use /user:administrator but I don't know the admin pass and I think the admin user (me) should work.

vangop
  • 169
  • 1
  • 5

2 Answers2

6

Runas does not elevate commands due to UAC.

You can't run elevated commands in the run dialog either. You can download the "Elevation Powertoys" which allow you to elevate commands as elevate <i>command</i>

Or just use the start menu and press Ctrl + Shift + Enter.

surfasb
  • 22,172
  • 5
  • 51
  • 76
0

You can use Administrator account for running a command on admin mode without UAC notification

runas /user:Administrator "cmd"

to save credential and run the command without retyping password again:

runas /user:Administrator /savecred "cmd"

NOTE:

Please make sure that you have activated Administrator user from Computer Management-> Local Users and Group and have set a safe password for Administrator user

Ali
  • 264
  • 2
  • 11