Vista Command Prompt: Elevated

2

1

What command can I use to confirm that I am running the command prompt elevated and what command can I use to force a program to run elevated from the command prompt?

facepalmd

Posted 2009-09-22T08:14:40.327

Reputation: 624

Answers

2

Use the runas command:

alt text

You can find more info in the Vista help.

harrymc

Posted 2009-09-22T08:14:40.327

Reputation: 306 093

0

to see whether the currently open command window has the priviledges you need, use whoami /groups This will show all the groups / tokens currently in use. Local admins would show up as NTAuthority\Administrators, which is probably what you are looking for. If your normal account is in this group anyway, you need to see if it is using this group "for deny only", in which case you are not elevated.

Personally, I created a new shortcut to CMD.exe, set the properties of the shortcut to run as Administrator (for which I use a different account at UAC), then change the properties of that window to have a different font and background colour (I use yellow text on blue background, your taste may be for lime on magenta, who knows?). I also increase the width and height of the screen, and make the buffer much bigger, as when I am doing admin type things I tend to want to go back further - some of those /? responses are pretty longwinded! Next time I use that shortcut, I do the UAC, then I have a window which looks very different from my non-elevated one.

AdamV

Posted 2009-09-22T08:14:40.327

Reputation: 5 011