Have you ever double-clicked a .txt file, expecting it to open in Notepad, but instead it launches in another program — like WordPad, Visual Studio Code, or even your browser?
That’s a file association issue.
When Windows forgets which app should open a certain file type, it’s usually because of:
- A recent Windows update
- New software installations
- Or manual file type changes in “Open with” settings.
In this guide, we’ll explain what file association means, why Notepad may lose it, and how to restore Notepad as the default app for text files — step by step.
What Is a File Association?
A file association tells Windows which program should open a particular file type.
For example:
.txt
→ opens with Notepad.docx
→ opens with Microsoft Word.html
→ opens with your web browser
If that link breaks, Windows doesn’t know which app to use — or uses the wrong one. That’s when you see your Notepad files opening in WordPad or another editor.
Why Notepad File Association Breaks
There are a few common reasons why this happens:
- A recent Windows update reset your defaults
Windows updates sometimes reassign default apps, especially after feature updates. - Another text editor took over
Installing software like Notepad++, Visual Studio Code, or Sublime Text often changes default associations. - Manual “Open with” change
If you manually selected another app and clicked “Always use this app,” it replaced Notepad. - Registry issues or missing system files
Damaged registry entries can cause Windows to forget the default Notepad path.
Fix 1: Set Notepad as Default via “Open With”
This is the easiest and fastest fix.
Steps:
- Right-click on any
.txt
file. - Choose Open with → Choose another app.
- Select Notepad from the list.
- Check the box that says Always use this app to open .txt files.
- Click OK.
✅ Now, every .txt
file will automatically open in Notepad.
Fix 2: Use Windows Settings to Reassign File Types
If the first method doesn’t work or you want to fix other extensions like .log
, .ini
, or .html
, you can do it from Windows Settings.
Steps (Windows 11 or 10):
- Press Win + I to open Settings.
- Go to Apps → Default apps.
- In the search bar, type Notepad.
- Click on Notepad in the results.
- You’ll see a list of file types it can open.
- For
.txt
,.log
,.ini
, or others — click the icon and select Notepad.
That’s it! Now Notepad will handle those file types automatically.
Fix 3: Use the “Set Defaults by App” Option
If you want to restore Notepad defaults for all its file types in one go:
- Open Settings → Apps → Default Apps.
- Scroll down and click Notepad.
- Click the Set default button (if available).
This reassigns every file type that Notepad supports back to it — including .txt
, .log
, .ini
, and .bat
.
Fix 4: Use “Default Programs” in Control Panel (For Older Windows)
If you’re on Windows 7 or Windows 8, Notepad settings are managed via Control Panel.
Steps:
- Open Control Panel.
- Go to Default Programs → Set your default programs.
- Find Notepad in the list.
- Click Set this program as default.
- Click OK.
That restores Notepad associations the classic way.
Fix 5: Manually Edit File Association Using “Default Apps by File Type”
Sometimes only .txt
files are fixed, but others (like .log
or .ini
) still open incorrectly.
In that case, use this deeper setting:
- Go to Settings → Apps → Default apps.
- Scroll down and click Choose defaults by file type.
- Find
.txt
→ assign Notepad. - Repeat for
.log
,.ini
,.bat
,.csv
, or.json
(optional).
This gives you full control over each file type.
Fix 6: Reinstall or Restore Notepad (If It’s Missing)
If Notepad isn’t showing in the app list, it might have been uninstalled or disabled accidentally.
To reinstall:
- Open Settings → Apps → Optional features.
- Click View features at the top.
- Search for Notepad.
- Click Install.
Once installed, Notepad will reappear and you can repeat the file association steps above.
Fix 7: Reset Default Apps (Complete System Reset)
If file associations are completely broken or many file types open with wrong programs, resetting everything may be best.
Steps:
- Go to Settings → Apps → Default apps.
- Scroll down and click Reset all defaults.
- Confirm the action.
This resets all file type associations (images, music, docs, etc.) to their original defaults — including Notepad.
Fix 8: Repair File Association via Registry (Advanced)
⚠️ For advanced users only — proceed carefully.
If nothing else works, you can manually restore Notepad association through the Registry.
Steps:
- Press Win + R, type
regedit
, and hit Enter. - Navigate to this key:
HKEY_CLASSES_ROOT\txtfile\shell\open\command
- Double-click the (Default) entry.
- Set its value to:
%SystemRoot%\system32\NOTEPAD.EXE %1
- Close Registry Editor and restart your PC.
✅ This restores .txt
file association directly at the system level.
💡 Always back up your registry before making changes.
Fix 9: Use Command Prompt to Reset File Association
If you prefer the command line, here’s a quick fix:
Steps:
- Open Command Prompt (Admin).
- Run this command:
assoc .txt=txtfile ftype txtfile="%SystemRoot%\system32\NOTEPAD.EXE" %1
- Press Enter and restart your PC.
Now .txt
files should open normally in Notepad.
Bonus: Restore Notepad for Other File Types
If other text-based files are opening incorrectly, use these commands (optional):
assoc .log=txtfile
assoc .ini=txtfile
assoc .cfg=txtfile
Each line ensures that Windows uses Notepad for these formats too.
Quick Troubleshooting Summary
Problem | Likely Cause | Fix |
---|---|---|
.txt files open in WordPad | Wrong default app | Fix 1 or 2 |
Notepad missing in list | App uninstalled | Fix 6 |
File opens with browser | MIME type issue | Fix 3 |
Advanced users need registry repair | Corrupt keys | Fix 8 |
Bulk file types misassigned | System reset | Fix 7 |
Pro Tip
If you work with multiple text editors like Notepad++ or VS Code, keep Notepad as your default viewer and use others manually for editing.
This keeps Windows clean and avoids confusion between default file types.
Final Thoughts
Notepad may look simple, but it’s one of Windows’ most trusted tools for decades.
If file associations break, don’t panic — just follow the methods above to restore them quickly.
You can:
- Reassign
.txt
files via “Open with” - Use Settings to set Notepad as default
- Or repair associations through registry or commands
Once restored, Notepad will once again open your files instantly — lightweight, fast, and distraction-free.