I'd like to change my default notepad program from notepad2
to notepad++
(but my question is more complicated than just that so please don't stop reading!) When making the change from notepad
to notepad2
a few months ago, I wasn't aware of symbolic links so I resorted to manually replacing the executables themselves (see footnote for more detail on how to do it without symlinks). Now that I've seen the light, I'd like to use symlinks for this purpose as it would be (really) good to not have to update the executables manually whenever a new version of notepad++
is released.
However, Windows is foiling my plans! Based on the following three observations, we can conclude that Windows 7 will automatically redirect (i.e., hijack!) any file or symbolic link named notepad.exe
that's located anywhere outside of the three default folders:
- If we create a symbolic link named
notepad++.exe
that's located inC:\
(i.e., outside of the three default folders) and that links to the original Notepad++ executable --> then double-clicking the symlink in Windows Explorer results in Notepad++ opening (great!) - But if we create try the same thing except give our symlink the name
notepad.exe
(i.e., this link is also hard-linked back to the Notepad++ executable) --> double-clicking it results in Notepad2 opening (wat) - Moreover, if we create a copy of the Notepad++ executable (i.e., not a symlink but a copy of the
.exe
file itself) and rename it tonotepad.exe
--> double-clicking this file will also open up Notepad2 (wat)
As you can see, my goal was to test the symlink in a separate folder prior to making symlinks in the correct system folders. My question has two parts:
- Is there any special process for making the change (described in the footnote) using symlinks given the behavior described above?
- Is there anyway to disable the OS's behavior for the
notepad.exe
moniker?
Footnote: For context, changing the default Notepad application in Windows 7 involves swapping out the notepad.exe
executable in three folders: C:\Windows\
, C:\Windows\System32
and, if you have a 64-bit system, C:\Windows\SysWOW64\
. (When making the change for the first time, we also need to go through some steps to give permissions but that's not relevant here.)