Problem Analysis
Context
The "Edit in Notepad" option appears in the right-click context menu for all file types. Since Notepad.exe does not support editing binary files, this option appears unnecessarily for .exe, .jpg, .mp4, and other binary files. Beyond being non-functional for these file types, it also creates visual clutter in the context menu.
Root Cause
This behavior stems from a feature introduced in the newer versions of Notepad. Testing confirms that version 11.2401.26.0 does not exhibit this issue. Systems with Windows 11 24H2 ship with the updated Notepad, which is why users encounter this problem on freshly installed systems.
Solution
Step 1: Open Registry Editor
Press Win+R to open the Run dialog, type regedit, and press Enter.
Step 2: Navigate to the Registry Path
Navigate to the following location:
HKEY_CLASSES_ROOT\PackagedCom\Package\
Step 3: Locate the Notepad Package
Find the registry key matching the patttern:
Microsoft.WindowsNotepad_XX.XXXX.XX.0_x64__8wekyb3d8bbwe
The "X" characters represent version numbers, which vary depending on the installed Notepad version.
Step 4: Navigate to the Class Subkey
Enter the following subdirectory:
\Class\{CA6CC9F1-867A-481E-951E-A28C5E4F01EA}
Step 5: Modify the ServerId Value
Locate or create the ServerId value and set the data according to your preference:
| Value Name | Type | Data |
|---|---|---|
| ServerId | REG_DWORD | 0 = Show option, 1 = Hide option |
Preventing Reappearance
To prevent this setting from being reverted during updates, you can create a HIPS rule using security software that supports custom registry protection.
Using Hu Rong Security (HuRong V5.0)
Create a .json file with the following rule definition:
{
"ver": "5.0",
"tag": "hipsuser",
"data": [
{
"id": 545,
"power": 1,
"name": "Block Notepad Context Menu Addition",
"procname": "*",
"treatment": 1,
"policies": [
{
"montype": 2,
"action_type": 4,
"res_path": "HKEY_CLASSES_ROOT\\PackagedCom\\Package\\Microsoft.WindowsNotepad_*\\Class\\{CA6CC9F1-867A-481E-951E-A28C5E4F01EA}\\ServerId"
}
]
}
]
}
Importing the Rule
- Open the Hu Rong main interface.
- Navigate to Protection Center > Advanced Protection > Custom Protection.
- Click Import under the Custom Rules section.
- Select the saved
.jsonfile.
Ensure both the Custom Protection feature and the specific rule are enabled. When the registry value is modified, the security software will alert you to the change.
Technical Note
The control switch resides in the registry path under HKCR\PackagedCom\Package\ rather than in the conventional context menu configuration location. Standard context menu management utilities may not recognize or handle this particular setting.