Notepad has been part of Windows for decades, simple, fast, and reliable for quick text editing.
But sometimes, after updates or software changes, Notepad stops working properly or opens with strange settings.
You might even notice that Notepad isn’t launching at all, or it’s replaced by another app (like Notepad++ or WordPad).
If that sounds familiar, don’t worry — you can restore the default Notepad app easily using the Command Prompt (CMD).
In this step-by-step guide, you’ll learn how to reset or reinstall Notepad back to its original Windows state.
Why You Might Need to Restore Notepad
There are a few common reasons why your Notepad might stop working or appear modified:
- 🧩 You changed the default text editor (to Notepad++, Sublime Text, or VS Code).
- 🔧 Windows updates corrupted Notepad settings.
- 🗑️ The Notepad app was accidentally uninstalled or disabled.
- ⚙️ File associations (.txt, .log) are pointing to another program.
- 💾 System files related to Notepad were damaged or missing.
Restoring the default Notepad through Command Prompt can fix all of these issues without reinstalling Windows.
Method 1: Reinstall or Restore Notepad Using CMD (Windows 10 & 11)
Starting from Windows 10 (version 1903) and later, Notepad is treated as a Windows optional feature — meaning you can uninstall or reinstall it like any other app.
Here’s how to restore it using Command Prompt:
Step 1: Open Command Prompt as Administrator
- Press Windows + S and type
cmd
. - Right-click Command Prompt and select Run as administrator.
You should see a window titled Administrator: Command Prompt.
Step 2: Check If Notepad Is Installed
Type the following command and press Enter:
DISM /Online /Get-Capabilities | find "Notepad"
If it shows:
Microsoft.Windows.Notepad~~~~0.0.1.0 [Not Present]
That means Notepad is uninstalled.
Step 3: Reinstall Notepad
To restore Notepad, type this command:
DISM /Online /Add-Capability /CapabilityName:Microsoft.Windows.Notepad~~~~0.0.1.0
Then press Enter.
Wait for a minute or two while Windows reinstalls the Notepad feature.
Once it finishes, you’ll see:
The operation completed successfully.
Step 4: Verify Installation
Now type:
notepad
If Notepad opens, congratulations — it’s restored! 🎉
You can also check in Windows Settings → Apps → Installed Apps → search for Notepad.
Method 2: Restore Notepad Default Settings (Without Reinstalling)
If Notepad opens but the font, layout, or encoding looks weird, you can reset its settings manually.
🔹 Step 1: Close Notepad completely
Make sure no Notepad windows are running.
🔹 Step 2: Open Command Prompt and type:
reg delete "HKCU\Software\Microsoft\Notepad" /f
Then press Enter.
This deletes Notepad’s saved configuration (like window size, font, etc.).
Next time you open Notepad, it will start fresh with default settings.
Method 3: Re-Associate .TXT Files with Notepad
Sometimes, other text editors take over the .txt
file association.
You can restore the default file association via Command Prompt too.
🔹 Step 1: Open CMD as Administrator
🔹 Step 2: Type this command:
assoc .txt=txtfile
and then:
ftype txtfile="%SystemRoot%\System32\notepad.exe" "%1"
✅ This command tells Windows to open all .txt
files using Notepad by default.
Try double-clicking any .txt
file — it should now open in Notepad again.
Method 4: Restore Notepad Using PowerShell (Alternative Way)
If Command Prompt doesn’t work, you can use PowerShell — another built-in Windows tool.
- Press Windows + X → choose Windows PowerShell (Admin).
- Type the following command:
Add-WindowsCapability -Online -Name Microsoft.Windows.Notepad~~~~0.0.1.0
- Wait for the process to complete, then restart your computer.
This command performs the same action as DISM — it reinstalls the default Notepad package.
Method 5: Restore Notepad Using Microsoft Store
If the CMD and PowerShell commands don’t work for some reason, you can also download Notepad manually from Microsoft’s official store.
- Open your browser and go to
👉 https://apps.microsoft.com/detail/notepad/9msmlrh6lzf3 - Click Get → choose Open Microsoft Store.
- Click Install or Reinstall.
After installation, you can open Notepad from the Start Menu or by typing notepad
in Run (Win + R).
🧰 Method 6: Repair Windows Components (If Notepad Still Doesn’t Work)
If even reinstalling doesn’t fix the problem, it might be due to system file corruption.
Run these two commands in CMD (Administrator):
🔹 Step 1: Scan and Repair System Files
sfc /scannow
This will check for and repair damaged Windows files.
🔹 Step 2: Use DISM to Restore Health
DISM /Online /Cleanup-Image /RestoreHealth
After this process completes, restart your PC and try opening Notepad again.
In most cases, this resolves all Notepad-related issues.
Method 7: Re-Enable Notepad as Default Text Editor
If you’ve replaced Notepad with another app (like Notepad++ or Sublime Text), follow these steps to set it back:
Using Command Prompt:
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.txt\UserChoice" /v ProgId /t REG_SZ /d txtfile /f
This resets the .txt
association to Notepad as the default editor.
Alternatively, you can do it manually:
- Right-click any
.txt
file. - Choose Open with → Choose another app.
- Select Notepad and check “Always use this app to open .txt files.”
Common Errors and Fixes
Problem | Cause | Solution |
---|---|---|
Notepad not found | Uninstalled or disabled | Run DISM reinstall command |
Notepad opens wrong font | Config corruption | Delete Notepad registry key |
.txt opens in WordPad | Wrong association | Use assoc & ftype commands |
CMD error 0x800F0954 | Windows update disabled | Enable Windows Update service |
App won’t open at all | System corruption | Run sfc /scannow |
Extra Tip: Backup Notepad Settings Before Resetting
If you want to reset Notepad but keep your font and layout preferences, export your registry key first:
- Press Windows + R, type
regedit
, and hit Enter. - Go to:
HKEY_CURRENT_USER\Software\Microsoft\Notepad
- Right-click Notepad → select Export → save as
notepad_backup.reg
.
You can restore it later by double-clicking the backup file.
Final Thoughts
Restoring the default Notepad via Command Prompt is quick and effective.
Whether your app stopped opening, got uninstalled, or lost its default settings — the DISM command or registry reset can bring it back in just a few minutes.
Remember:
- Use DISM or PowerShell to reinstall.
- Use reg delete to reset settings.
- Use assoc/ftype to fix file associations.
With these simple commands, you can make Notepad behave exactly as it did when you first installed Windows — clean, fast, and reliable.