Walker News

Windows Vista Open Command Prompt Here With Elevated Privilege

Unlike Windows XP, Windows Vista built-in an easy but imperfect option to open command prompt window at a specific folder path – just press the SHIFT key while right-click a folder or drive and click the “Open Command Window Here” option in the pop-up context menu!

It’s imperfect, as the Windows Vista UAC will run this command prompt window as a standard user process. Having say that, you can’t use it to execute a command or perform an action that required administrator privilege!
While Windows Vista UAC is turned on (by default), all user-trigger command / program /action will run as a standard user process. That’s means you won’t able to execute a command or perform an action that access or require administrator privilege, even if you’re currently logon as Administrator!

User Account Control is the promise of Windows Vista security! But, you may take time to get used with it, as you’ll regularly prompted to acknowledge an action that required administrator privilege, no matter you’re logon with a user account of Vista Administrator group!

But, I insist to turn on UAC on my my Vista Ultimate, for the security concerns and the price of Windows Vista! After all, I’m getting used to it as days go on!

How to tell if the Vista Command Prompt is elevated with Administrator privilege?

The “Administrator:” keyword will appears in Windows Vista Command Prompt window caption bar, as shown in this diagram

How to tell if a Vista Command Prompt is running with elevated privilege? Notice that the Administrator keyword will appears in the Windows Vista Command Prompt caption bar to indicate it is running as an administrator process or with elevated privilege.

So, how to permanently open Windows Vista Command Prompt window with elevated privilege?

Here are two options (I prefer the the first Vista Trick – Elevated Vista Command Prompt shortcut in Windows Context menu):

A) How to enable Windows Vista “Open Command Window Here” with elevated privilege?

1) Click the Vista Start button, type regedit and press ENTER to bring up Windows Vista Registry editor.

2) Locate to this Registry path

HKEY_CLASSES_ROOT\Directory\shell

3) Create a new key that named as runas

4) Create a string value, named it as (Default), and key in a meaningful description (which will appears as an option in context menu). For my case, I enter “Open Administrator Command Window Here”

5) Right-click Runas registry key, select New follow by Key to create another new key and named it as Command

6) Create a new string value for Command key, named it as (Default), and enter this string value

cmd.exe /k "pushd %L && title Elevated Command Prompt Window"

7) Locate to this Registry path

HKEY_CLASSES_ROOT\Drive\shell

and repeat step 3 to step 6 again. Close the Windows Registry editor after completing all the steps!

Now, right-click on a folder or drive, click the new “Open Administrator Command Window Here” option in the pop-up context menu, which will open Windows Vista command prompt at the specific folder (the folder being right-click) with elevated privilege!

Right-click on a folder or drive, click the new Open Administrator Command Window Here option in the pop-up context menu, which will open Windows Vista command prompt at the specific folder - the folder being right-click - with elevated privilege! This is the most convenient and efficient way of using Vista Command Prompt options - compiling my C#, C, or Java source codes in command line has never been such easier!

This is the most convenient and efficient way of using Vista Command Prompt options – compiling my C#, C, or Java source codes in command line has never been such easier!

In case you can’t follow my poor instructions at above, or you’re not comfortable to edit the Windows Registry, you copy these block of Windows Registry script to Notepad, save it as a Windows Registry file (i.e. end with .Reg file extension), and double-click it to execute:
Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\Directory\shell\Runas]
@="Open Administrator Command Window Here"

[HKEY_CLASSES_ROOT\Directory\shell\Runas\Command]
@="cmd.exe /k \"pushd %L && title Elevated Command Prompt Window\""

[HKEY_CLASSES_ROOT\Drive\shell\Runas]
@="Open Administrator Command Window Here"

[HKEY_CLASSES_ROOT\Drive\shell\Runas\Command]
@="cmd.exe /k \"pushd %L && title Elevated Command Prompt Window\""

B) Create a Command Prompt shortcut and turn on “Run As Administrator” feature

1) Locate the Command Prompt in Vista Start menu. Click the Vista Start button and type cmd in the Start Search text box – the Command Prompt program (cmd) will appears in the program list.

2) Create a shortcut of Command Prompt – Right-click the Command Prompt (cmd) and drag it to Vista Desktop or Quick Launch toolbar, release the right-click and select Create Shortcuts Here option in the pop-up context menu.

[CAUTION] Execute this step with care – Don’t click the “Move Here” option as it will move the cmd program out from its default location in %windir%\system32.

3) Right-click the shortcut created in step 2 and select the Properties option

4) Click the Shortcut tab follow by Advanced… button

5) Tick the check-box labelled as “Run As Administrator”.

Create a Vista Command Prompt shortcut with elevated privilege or administrator privilege.

6) Click OK all the way to close all open dialog boxes. From now onwards, whenever you click this new Command Prompt shortcut will trigger Windows UAC asking for your permission to continue. Just press Continue to proceed running the Vista Command Prompt as administrator process, i.e elevated with administrator privilege!

Custom Search

  1. Re-create Show Desktop Shortcut And Quick Launch Toolbar » Walker News 28-05-07@23:30

    […] you’re using Windows Vista, you may interested on how to create shortcut of an elevated-privilege Command Prompt in the Quick Launch toolbar […]

  2. Copy And Paste Text In Command Prompt – Walker News 27-06-07@21:53

    […] Skip this step if it’s already done ] Create an elevated privilege Command Prompt shortcut in Quick Launch toolbar, […]

  3. Setup Remote Desktop Port Forwarding In Windows Vista – Walker News 30-07-07@01:19

    […] randomly select a port number (say 9999) and type netstat -ant | find “9999″ in an elevated privilege Vista Command Prompt window. The command will show empty output if the TCP port is free or […]

  4. How To Create ISO Image In Windows Vista – Walker News 23-09-07@03:15

    […] To create or write an ISO image of a Windows folder or CD/DVD-ROM, use the Windows right-click Context menu. […]

  5. mokhet 31-12-07@05:17

    great., just perfect to increase the speed to make command line compilation of my PSP homebrew.

    Thanks.

  6. jlogan 11-01-08@01:23

    thank you so much for this info.
    i was trying to do mklink for about half hour
    i had a sole account which was of type administrator, and still had permission issues…

  7. Sam 07-03-08@14:41

    Thank you for posting the admin window tips. Great job!

  8. How To View RSS Feed In XML Format With Firefox – Walker News 18-04-08@15:18

    […] Well, it’s not because of Firefox, but this is likely due to Windows Vista UAC security feature! I’ve successfully save the change by using Notepad++ that was executed in an elevated Command Prompt window! […]

  9. Muzi 11-11-08@19:57

    thanks this worked well

  10. How To Disable Or Enable User Switching In Windows Vista? 29-05-09@00:09

    […] If you’re not comfortable with Registry editing, stop here or be careful. 1) Open an elevated Command Prompt (i.e. a Command Prompt window with real Administrator privilege), 2) Copy and paste the following […]

  11. geekslayer 25-04-10@11:33

    Interesting. I first did the thing with making the cmd prompt window
    open full screen. And it was working. Then I did the create and elevated cmd prompt in the quick launch bar and it works but now the cmd prompt window doesn’t open to full screen.

    Update:
    I re-did the maximize cmd window. Now it’s working with the short-cut in the quick launch.
    Thanks. Very useful to me.

  12. Dwayne 18-02-13@01:40

    Thanks a lot, this really helped ^^

2014  •  Privacy Policy