Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 

Repository files navigation

Restore "New Text Document" & "Open with Notepad" on Custom Windows Builds

If you're running a customized Windows edition like GhostSpectre or any “debloated” version, you’ve probably noticed that the right‑click (context) menu is missing:

  • New → Text Document – the quick way to create a blank .txt file.
  • Open with Notepad – when you right‑click a .csv, .log, .json, or any other file.

This happens because these builds often strip out registry entries and shell extensions to reduce footprint. The underlying txtfile file class is either incomplete or completely missing, and the {D969A300...} CLSID that powers the “New” menu may be unregistered.

This repository provides a simple batch script that restores both entries in one go – and it works on any Windows 10/11 system, not just custom builds.


📌 What the Script Does

  • Associates .txt files with Notepad (sets the default open command).
  • Adds the “New → Text Document” menu item.
  • Adds “Open with Notepad” to the context menu for any file type (.csv, .json, .ini, .cfg, etc.).
  • Restarts Windows Explorer to apply the changes immediately.

🔧 Requirements

  • Administrator privileges – the script will automatically request elevation.
  • Notepad.exe must exist – usually at C:\Windows\System32\notepad.exe.
    • If you’re using a really stripped build where Notepad itself is removed, the script will warn you.
    • You can then install Notepad via Settings → Optional Features or manually copy it from another Windows installation.

📥 How to Use

Option 1 – Run the batch file (recommended)

  1. Download or copy the script below and save it as FixContextMenu.bat.
  2. Right‑click the file and select “Run as administrator”.
  3. Follow the on‑screen prompts – the script will do everything automatically.
  4. After completion, right‑click on your desktop or any file – the entries should appear immediately.

Option 2 – Manual registry edits (advanced)

If you prefer to apply changes manually, open an elevated Command Prompt and run these commands one by one:

:: Associate .txt with "txtfile" class
reg add "HKCR\.txt" /ve /d "txtfile" /f

:: Add "New Text Document"
reg add "HKCR\.txt\ShellNew" /v NullFile /t REG_SZ /d "" /f

:: Set display name for txtfile (this is what appears in the New menu)
reg add "HKCR\txtfile" /ve /d "Text Document" /f

:: Set default icon
reg add "HKCR\txtfile\DefaultIcon" /ve /d "%SystemRoot%\System32\imageres.dll,-102" /f

:: Set Notepad as the open command
reg add "HKCR\txtfile\shell\open\command" /ve /d "\"%SystemRoot%\System32\notepad.exe\" \"%%1\"" /f

:: Add "Open with Notepad" for all files
reg add "HKCR\*\shell\Open with Notepad" /ve /d "Open with Notepad" /f
reg add "HKCR\*\shell\Open with Notepad\command" /ve /d "\"%SystemRoot%\System32\notepad.exe\" \"%%1\"" /f

:: Restart Explorer
taskkill /f /im explorer.exe & start explorer.exe

About

Restore "New Text Document" & "Open with Notepad" on Custom Windows Builds

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages