Plenty of people who spend real time editing code eventually get tired of Notepad opening every time they double-click a text file. The good news is you don’t need to touch any protected system files to fix this — Windows already gives you a supported way to change which program opens by default.
Before you begin
Close any text files you currently have open, and make sure you know where your preferred code editor is installed. That’s really the only preparation required.
Changing the default program for a file type
Right-click any file with the extension you want to redirect — .txt is the most common starting point — and choose “Open With” from the context menu. Windows will show a list of programs it already knows about, plus an option to browse for another one.
Select “Choose another app,” then browse to wherever your code editor is installed and select its executable. Before confirming, make sure the box labeled something like “Always use this app” is checked. Click OK, and from that point forward, double-clicking a file of that type will open it in your chosen editor instead of Notepad.
Repeating this for other extensions
The same steps work for any other extension you edit regularly, like .html, .css, .js, or .php. Each file type keeps its own association, so you can send plain .txt files to one program while directing your web-development files to your code editor, if that split makes sense for your workflow.
Keeping Notepad around
There’s no need to remove Notepad itself. Leaving it installed costs nothing, and it’s still genuinely useful for the rare moment you want the absolute fastest, no-frills option — opening a quick note, or viewing a file when you’re troubleshooting on someone else’s machine and don’t want to install anything new.
Why this matters
Once your file associations are set correctly, the switch to a real editor stops being a conscious choice you make every time and just becomes how your computer behaves by default. That’s really the whole point: remove the friction, and the better tool wins simply by being there when you need it.
If you ever want to revert, the same “Open With” dialog lets you point a file type back at Notepad, or anything else, just as easily — nothing about this process is permanent or hard to undo.