Fix Notepad File Association in Windows
Fix Errors

Fix Notepad File Association in Windows

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:

  1. A recent Windows update reset your defaults
    Windows updates sometimes reassign default apps, especially after feature updates.
  2. Another text editor took over
    Installing software like Notepad++, Visual Studio Code, or Sublime Text often changes default associations.
  3. Manual “Open with” change
    If you manually selected another app and clicked “Always use this app,” it replaced Notepad.
  4. 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:

  1. Right-click on any .txt file.
  2. Choose Open with → Choose another app.
  3. Select Notepad from the list.
  4. Check the box that says Always use this app to open .txt files.
  5. 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):

  1. Press Win + I to open Settings.
  2. Go to Apps → Default apps.
  3. In the search bar, type Notepad.
  4. Click on Notepad in the results.
  5. You’ll see a list of file types it can open.
  6. 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:

  1. Open Settings → Apps → Default Apps.
  2. Scroll down and click Notepad.
  3. 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:

  1. Open Control Panel.
  2. Go to Default Programs → Set your default programs.
  3. Find Notepad in the list.
  4. Click Set this program as default.
  5. 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:

  1. Go to Settings → Apps → Default apps.
  2. Scroll down and click Choose defaults by file type.
  3. Find .txt → assign Notepad.
  4. 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:

  1. Open Settings → Apps → Optional features.
  2. Click View features at the top.
  3. Search for Notepad.
  4. 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:

  1. Go to Settings → Apps → Default apps.
  2. Scroll down and click Reset all defaults.
  3. 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:

  1. Press Win + R, type regedit, and hit Enter.
  2. Navigate to this key: HKEY_CLASSES_ROOT\txtfile\shell\open\command
  3. Double-click the (Default) entry.
  4. Set its value to: %SystemRoot%\system32\NOTEPAD.EXE %1
  5. 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:

  1. Open Command Prompt (Admin).
  2. Run this command: assoc .txt=txtfile ftype txtfile="%SystemRoot%\system32\NOTEPAD.EXE" %1
  3. 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

ProblemLikely CauseFix
.txt files open in WordPadWrong default appFix 1 or 2
Notepad missing in listApp uninstalledFix 6
File opens with browserMIME type issueFix 3
Advanced users need registry repairCorrupt keysFix 8
Bulk file types misassignedSystem resetFix 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.

Leave a Reply

Your email address will not be published. Required fields are marked *