How to Add a Right-Click Menu Option to Run a Program Elevated

From the Windows Taskbar, you can start a program elevated by holding the Ctrl & Shift keys and then clicking on a pinned shortcut. 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.

This article tells you how to add a right-click menu option to run a program elevated.

Example: 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 set “Notepad (Administrator)” as the data
  4. Create a string value named HasLUAShield
    (This adds the UAC shield icon to the context menu item. Ref: Add UAC Shield Icon to the Right-Click Menu)
  5. Create a string value named Extended

  6. Under the 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

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



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

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

take ownership right-click menu


One small request: If you liked this post, please share this?

One "tiny" share from you would seriously help a lot with the growth of this blog. Some great suggestions:
  • Pin it!
  • Share it to your favorite blog + Facebook, Reddit
  • Tweet it!
So thank you so much for your support. It won't take more than 10 seconds of your time.

Ramesh Srinivasan is passionate about Microsoft technologies and he has been a ten-time recipient of the Microsoft MVP award in Windows Desktop Experience (Windows Shell), from 2003 to 2012. Ramesh founded Winhelponline.com in 2005.

Leave a Comment