In article 113 How to open an elevated Command Prompt from the folder context menu in Windows Vista (published in December 2006) we saw how to add the Open Command Window here (Administrator) option for file system folders in Windows Vista.

Here is how to add this option in the Desktop context menu.

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\Directory\Background\shell\runas]
@="Open Command Window here (Administrator)"
"Extended"=""
"NoWorkingDirectory"=""

[HKEY_CLASSES_ROOT\Directory\Background\shell\runas\command]
@="cmd.exe /s /k pushd \"%V\""

Copy the above lines to Notepad, and save the file with .REG extension, say cmd-admin.reg. Then right-click the .reg file and choose Merge. You’ll see see an Open Command Window here (Administrator) option as shown in the above figure, when you hold down the SHIFT key and right-click on the Desktop.

This uses the same runas technique used in article 113 How to open an elevated Command Prompt from the folder context menu in Windows Vista to trigger the elevation prompt.

Related Posts


Email SubscriptionPrefer an E-mail subscription?

Enter your email address:

Delivered by FeedBurner

One Comment

  1. Skorbion
    said this on Saturday, January 10th 2009 6:44 pm

    For XP:
    http://www.roggel.com/NGNeer/BackgroundCMD/

Leave a Reply