How to Add a Custom ‘Open with Notepad’ Option to the Windows 11 Context Menu

If you are a programmer, sysadmin, or just a power user, you frequently need to inspect the raw contents of random files—whether it is a .json config file, an unfamiliar .log output, or a script without a recognizable extension. Double-clicking these files usually results in Windows throwing a frustrating “How do you want to open this file?” dialogue box.

To avoid this, you can force Windows to add a permanent, hardcoded “Open with Notepad” button directly to the right-click context menu for every single file type on your system, regardless of its extension. This allows you to instantly force-open any file as plaintext without messing up your default application associations.

Important Warning

Editing the Windows Registry can cause system instability if you delete the wrong keys. It is highly recommended to create a System Restore point before proceeding, just in case you make a mistake.

Step 1: Open the Registry Editor

  1. Press the Windows Key + R on your keyboard to open the Run dialog box.
  2. Type regedit into the text box and press Enter. Click “Yes” if prompted by User Account Control to grant administrative privileges.

Step 2: Navigate to the Global Class File Extension

We need to target the registry folder that applies rules to literally every file type on the system, which is represented by the * (asterisk) key.

  1. Copy and paste the following path directly into the address bar at the top of the Registry Editor, and press Enter:
    HKEY_CLASSES_ROOT\*\shell
  2. If the “shell” folder does not exist: You must create it. Right-click on the * folder, select New > Key, and name it exactly shell.

Step 3: Create the “Open with Notepad” Button

Now we will create the actual text that appears when you right-click.

  1. Right-click on the shell folder.
  2. Select New > Key.
  3. Name this new key exactly what you want the button to say (e.g., Open with Notepad).

Step 4: Tell the Button What to Do

Now we have to link that button to the actual Notepad executable.

  1. Right-click on the newly created Open with Notepad folder.
  2. Select New > Key.
  3. You must name this new key exactly: command (all lowercase).
  4. Click on your new command folder so it is highlighted in the left pane.
  5. Look at the right-hand pane. Double-click the file named (Default).
  6. In the “Value data” box, type the following command exactly as written:
    notepad.exe "%1"
  7. Click OK.

(Note: The "%1" variable tells Windows to take whatever file you just right-clicked and pass its exact file path directly into the Notepad application).

Step 5: Test the Context Menu

The changes apply instantly. You do not even need to restart Windows Explorer.

  1. Close the Registry Editor.
  2. Go to your desktop and right-click on any file (an image, a PDF, a shortcut).
  3. Click “Show more options” (or hold Shift while right-clicking).

You will see a brand new “Open with Notepad” button. Clicking it will instantly force the file into a Notepad window, allowing you to view its raw, underlying code immediately.

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.