In the Windows 7 Taskbar, you can start a program elevated by holding the CTRL & SHIFT keys and then clicking on a Pinned shortcut. Unfortunately there are no keyboard shortcuts available to start a program elevated via the context menu. To launch a program elevated from the right-click menu, you can add custom entries and launch it using a script or using the NirCmd utility. Earlier we wrote about the new "elevate" command-line argument in NirCmd, which you can implement in the context menu.

Add "Notepad (Administrator)" Option to the Context Menu

1. Click Start, type Regedit.exe and go to:

HKEY_CLASSES_ROOT\*\shell

2. Create a subkey named Notepad

3. Select Notepad, double-click the (default) value and "Notepad (Administrator)" as the value data

4. Create a string value named HasLUAShield

(This adds the UAC shield icon to the context menu item in Windows 7. REF: Add UAC Shield Icon to the Right-Click Menu)

5. Create a string value named Extended

6. Under Notepad key, create another subkey named Command

7. Select Command, and type in the following value data for (default)

"C:\Windows\System32\nircmd.exe" elevate notepad.exe "%1"

(Assuming that you’ve copied NirCmd.exe to the Windows\System32 directory.)

8. Exit the Registry Editor.

Press and hold the SHIFT key down, right-click on a file (say, the HOSTS file) that you want to edit using Notepad under elevated privileges, and then click Notepad (Administrator)

Other Possible Uses

#1 Register and Unregister DLLs from the Right-click menu. (REG file)

#2 Open an elevated Command Prompt window from the Desktop context menu. (REG file)

#3 Take Ownership of a file or folder from the context menu. (REG file)


Related Posts


Email SubscriptionPrefer an E-mail subscription?

Enter your email address:

Delivered by FeedBurner

2 Comments

  1. said this on Thursday, August 19th 2010 8:02 am

    [...] How to Run a Program Elevated via the Right-Click Menu in Windows 7/Vista? [The Winhelponline Blog] | More document.write(''); Posted on 08/18/10 [...]

  2. Fleet Command
    said this on Thursday, August 19th 2010 3:06 am

    My hero! That’s just what I needed.

    Now, Notepad isn’t as good a candidate as Notepad++ is; especially when a Hex Editor plug-in is installed on the Notepad++. Think of the possibilities!

Leave a Reply