Changing the Default Text Editor (for Dummies)

Questions & Answers

Moderators: fgagnon, nikos, Site Mods

Post Reply
Kilmatead
Platinum Member
Platinum Member
Posts: 4573
Joined: 2008 Sep 30, 06:52
Location: Dublin

Changing the Default Text Editor (for Dummies)

Post by Kilmatead »

This may seem like a "no-brainer" for most people - to change the default editor from Notepad to something else, either play around in the registry a bit or just change the filetype associations, right?

Not quite.  Even though you've gone through all the trouble of making ed2 or Notepad++ or Notepad2 (or whatever you use) the default text editor, there's always some smart-arse application (such as the x2 installation program) which insists upon opening the changes.txt by default in Windows notepad, regardless of your wishes.  To combat things like this the usual route is to actually replace the C:\Windows\System32\notepad.exe physically, which seems a little dirty for some people.

Curiously, someone thought up the NotePadReplacer utility, which does exactly what it says on the tin - even intercepting direct calls to the notepad.exe and opening your chosen editor instead.

I am a little curious how it manages to intercept the notepad.exe itself (if you click on it you get your chosen editor - almost as if the file was replaced - except it wasn't.  Interesting.

Anyway, this is a clean and simple solution for those who don't like poking around windows entrails for little obvious things.

Works fine with editor2.exe and editor2_x64.exe, though I don't know what happens if you try to associate portable editors with it.

(Now, if someone would create one of these for firefox.exe we'd be able to eradicate all of Nikos' little oversights! :D)
User avatar
nikos
Site Admin
Site Admin
Posts: 15771
Joined: 2002 Feb 07, 15:57
Location: UK
Contact:

Post by nikos »

did you try the registry key
HKEY_CLASSES_ROOT\SystemFileAssociations\text
Kilmatead
Platinum Member
Platinum Member
Posts: 4573
Joined: 2008 Sep 30, 06:52
Location: Dublin

Post by Kilmatead »

nikos wrote:did you try...
I'm merely positing this as a simple and clean solution for people who don't enjoy trekking through the registry detritus, unlike some jazzy-coders. :wink:

And if you find this so simplistic, how is it you eternally fail to respect the user's choice of default browser in "that other application" of yours?

Hmm?  (Listening to crickets playing violins...)

I thought so.  :rolleyes:
Tuxman
Platinum Member
Platinum Member
Posts: 1610
Joined: 2009 Aug 19, 07:49

Re: Changing the Default Text Editor (for Dummies)

Post by Tuxman »

Kilmatead wrote:Curiously, someone thought up the NotePadReplacer utility, which does exactly what it says on the tin - even intercepting direct calls to the notepad.exe and opening your chosen editor instead.
Now that I wasted lots of hours changing several registry entries in order to make everything on my system work alright with my beloved Vim, this is certainly a great idea. Thank you!  :)
Tux. ; tuxproject.de
registered xplorer² pro user since Oct 2009, ultimated in Mar 2012
User avatar
FrizzleFry
Platinum Member
Platinum Member
Posts: 1241
Joined: 2005 Oct 16, 19:09

Post by FrizzleFry »

NotePadReplacer might be using the method described here to "replace" Notepad.
Kilmatead
Platinum Member
Platinum Member
Posts: 4573
Joined: 2008 Sep 30, 06:52
Location: Dublin

Post by Kilmatead »

Image

Yep, looks like a "re-direction of a re-direction" using the same registry keys.  Probably using its own call to iron out whatever those "incompatibilities" mentioned for np2 were, so other editors don't need to worry about needing modifications.

Interesting solution, but it works.
Kilmatead
Platinum Member
Platinum Member
Posts: 4573
Joined: 2008 Sep 30, 06:52
Location: Dublin

Post by Kilmatead »

For anyone interested in following up (or exploiting for their own use) the IFEO (Image File Execution Options) registry trick, see here for a practical tutorial.

Apparently if you "just" add the requisite application names to the registry, windows automatically inserts a copy of the called path as a passed command line argument, which is impractical.  The above tutorial provides example VBS code to circumvent said inconvenience.  Very useful for redirecting regedit.exe calls and the like, for those desperate to do such things. :wink:
Post Reply