Textpad to open instead of Notepad

General questions about using TextPad

Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard

Post Reply
Hemal
Posts: 5
Joined: Tue Feb 03, 2004 4:34 am

Textpad to open instead of Notepad

Post by Hemal »

I want Textpad to open instead of Notepad i.e. whenever I launch command to open notpad it should open Textpad.
To do this I used the Txplink.exe file (availabe under addons on Textpad website) renamed it to notepad.exe and copied it to c:\winnt\system32 directpry and c:\winnt\system32\dllcache directory.
If I open Notepad immediately after this it opens Textpad but after few minutes when I launch notepad it does not launch Textpad it launches Notepad.
Any comments how this can be avoided.
User avatar
MudGuard
Posts: 1295
Joined: Sun Mar 02, 2003 10:15 pm
Location: Munich, Germany
Contact:

Post by MudGuard »

look at the Add-ons Page, under "Utilities" you will find tools called txplink or similar (different versions for different Windows versions)
User avatar
s_reynisson
Posts: 939
Joined: Tue May 06, 2003 1:59 pm

Post by s_reynisson »

Looks like you're forgetting the notepad.exe in c:\winnt dir.
Here's a good link http://www.notepad-replacements.com/index.html
Detailed directions for most OS's there.
Then I open up and see
the person fumbling here is me
a different way to be
Hemal
Posts: 5
Joined: Tue Feb 03, 2004 4:34 am

Post by Hemal »

That worked fine Thanks :D
Hemal
Posts: 5
Joined: Tue Feb 03, 2004 4:34 am

Post by Hemal »

oops it worked only for a short time after that it didn't work. :cry:
I replaced the file in all three locations c:\winnt , c:\winnt\system32, c:\winnt\system32\dllcache.
After this I tried to search for notepad.exe on the system and I found the notepad.exe in following folders
1 c:\winnt
2 c:\winnt\system32
3 c:\winnt\system32\dllcache
4 C:\WINNT\system32\NtmsData
When I run Notepad.exe from first three folders in launches Notepad and when I launch notepad.exe from 4th folder in launches Textpad. :idea:
User avatar
MudGuard
Posts: 1295
Joined: Sun Mar 02, 2003 10:15 pm
Location: Munich, Germany
Contact:

Post by MudGuard »

Which Windows version are you running?

I think starting with Win2000 there is a mechanism built into Windows that tries to repair a "damaged" system. Windows treats replacement of notepad.exe as damage to the system and restores the original notepad.

This behaviour can be configured so you get asked whether you want your system repaired - don't ask me where this setting has to be done...

If you have it configured that way, do your replacement again and on the questions from window whether to repair that damage, answer no.
molafish
Posts: 2
Joined: Thu Apr 15, 2004 9:59 am
Contact:

Post by molafish »

Interesting phenomenon. So you say windows is automatically restoring it's copy of notepad? That should not happen in the background...

As mudguard has brought up, Windows File Protection is running by default for Windows 2000 on up. And when it finds that a protected system file (i.e. notepad.exe) has been tampered with, it will try to replace it with the cached copy in /dllcache.

So I can see how WFP would restore from the cache dir without notifying you, but if you replace the dllcache file as well, windows should alert you and ask to put in your OS CD, to which you can then say cancel and confirm with a "yes." WFP won't bother you again.

These should be the only necessary steps (short from replacing the other copies of notepad on your system).

It's weird that your system seems to be automatically restoring the file from nothing. The only thing I can think of is to be careful of the order in which you replace the copies. Try this order:

%SystemRoot%\system32\dllcache
%SystemRoot%\windows or %SystemRoot%\winnt
%SystemRoot%\system32
any other dirs (not sure what \NtmsData is)
my XP state only returns the first 3 hits

You might also want to turn WFP off for the duration of your replacing. But this shouldn't be necessary because all you have to do is say no to the Insert Windows 2000 Install CD dialog. I am not sure where this is anyway, you will probably have to look into some OS preference editor like TweakUI for that... I know that some exploitation methods for Windows XP (relax mods I'm not advocating anything) require turning WFP off to get around microsoft security implementation, so you might browse some of their finer web sites (make sure you have a pop-up blocker running) for a method for doing so.

Or you could simply ask microsoft, but I found getting relavent hits from their search bar about as helpful as trying to drive a nail with a bar of Ivory soap...

Anyway, one more thing you could do... It's not the best option, or the easiest, but it will work guaranteed.

Instead of replacing copies of notepad, change all pointers in your system state to your preferred editor, i.e. Textpad.

Offhand, this would mean editing all the shortcuts you would normally use notepad for (start menu-programs-accessories-system tools), view source under IExplore, right-click context menu Edit command, etc... you can edit how your system accesses explicit file types through the Tools/Folder Options/File Types tab...

The View Source and some other hard to reach fields must be edited in the registry. You are most likely going to find that under HKEY_LOCAL_MACHINE\software\microsoft\IEXPLORE or something (maybe Internet Explorer). Once you get there look for some key like View Source or ViewSource Editor (I'm just stabbing in the dark here, windows install usually has no key of this name, you have to create it manually). Once you've found/created that key (try different names until it works?), make a sub-key called Editor Name and (I'm sure about that one) initialize its value to the absolute path of Texpad or whatever, place inside double quotes. Test your attempt by restarting IE and viewing source; if it don't work, try another name...

Sorry my memory sucks, but I'm sure some other user has come up with a similar View Source workaround in this board... do a search for the proper name if you care that much...

Um... what else...
Of course with this pain-in-the-neck method you will probably not be able to replace all references to notepad.exe with textpad.exe, but this is only being attempted because your Windows File Protection is acting like a know-it-all.

Perhaps it has something to do with your service pack version? Try updating and then replacing notepad.exe in the proper order.

Best of luck.

Personally I love the Textpad right-click context menu addition. I use it all the time (did Helios do that or did I? I forget...)
joelmw
Posts: 20
Joined: Wed Mar 10, 2004 4:48 pm
Location: DFW
Contact:

I386

Post by joelmw »

It's weird that your system seems to be automatically restoring the file from nothing.
This had happened to me on a previous W2K install and I just never monkeyed with it. Recently I ran into it with W2K advanced server even though the fix on W2K Pro worked just fine. Just as Hemal has mentioned, the old notepad.exe seemed to reappear out of thin air. :?

But I thought for a moment about the replacement process and the prompt for a CD. It occured to me: "What if the CD is already in the drive?" . . . then, "What if I didn't install from a CD?" :idea:

Sure enough, there was my good friend I386. Windows didn't need to ask me for a CD because it had everything it needed and could go about executing its frustratingly misguided good intentions. I don't know what the recommended procedure is but I went into I386 and renamed NOTEPAD.EX_ to bad old NOTEPAD.EX_, redid the copies and we're all good now. :D

Getting rid of I386 would work. Maybe changing the install path in the registry might, too.

Hope this helps sombody.
Grace and Peace,
Joel
molafish
Posts: 2
Joined: Thu Apr 15, 2004 9:59 am
Contact:

Post by molafish »

I think you've got it.

I forgot about the I386 folders. My computers never come pre-installed. But you're absolutely right. Go into those folders and do what joelmw did. It should work.
Post Reply