Loading ...
Sorry, an error occurred while loading the content.

Replacing MS Notepad with NoteTab

Expand Messages
  • ladyck3@tx.rr.com
    From Jim Hall (May he Rest In Peace… Miss you Jim) A rather lengthy bit of information on replacing MS Notepad with NoteTab, but well worth the read.
    Message 1 of 1 , Jul 2 10:48 AM
    • 0 Attachment
      From Jim Hall (May he Rest In Peace… Miss you Jim) A rather lengthy bit of information on replacing MS Notepad with NoteTab, but well worth the read.

      ==============================

      Replacing Notepad With NOTETAB As Default Editor In Winxx


      Anyone who wants a better understanding of associating NOTETAB in Windows should find this document informative.




      ALL ABOUT REPLACING Notepad WITH NOTETAB AS DEFAULT EDITOR IN WINXX'S

      By Jim Hall

      Revised 1/05/02


      INTRODUCTION:
      ¯¯¯¯¯¯¯¯¯¯¯¯¯
      In Win9X and WinME systems there is an option in NOTETAB HELP to replace Notepad with NOTETAB. It works fine, some of us use it, and since it works we have taken it for granted as another of Eric's miracles.

      Since the introduction of Win2K the subject of Replacing Notepad.exe with NOTETAB in Win2K and WinXP has lead to many posts on the user lists.

      Win2K and WinXP work a little different than Win9X and WinME and as a result the Option to replace Notepad with NOTETAB found on systems using Win9X and WinME was disabled in version 4.85 for systems running Win2K and XP because it didn't seem to work correctly in Win2K and XP.

      The Option to replace Notepad with NOTETAB was re-enabled in version 4.86 for systems running Win2K and XP because we figured out that it does work and how to make it work properly.

      There were Clips generated which will change registry settings to make NOTETAB the default editor for the Internet Explorer and to provide a right click option for editing HTML type files. From my observations, these have caused more problems than they resolved.

      Today we have a better understanding of how Win2K and WinXP work and as a result we can do exactly the same thing in Win2K and WinXp that we do in Win9X and WinME - only a little differently.

      I say differently mainly because we have to do part of it "MANUALLY" instead of letting NOTETAB do it all for us.

      The "Windows File Protection System" (WFP) which is new with Win2K and WinXP protects one of the files that must be changed and you can only over-ride it MANUALLY.

      This document attempts to give background to those who might need it and answer why we would want to replace Notepad with NOTETAB as well as explain how it is done in Win9X and WinME and how it can be done in Win2K and WinXP.



      IMPORTANT NOTES:
      ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯

      In the following text "NOTETAB" implies all versions of NOTETAB and it must be understood that all have different .exe filenames and different paths.

      It is important to give special attention to the file names and extensions used in this text as they differ depending on what file is being discussed and at what point in the procedure. Also it is easy to confuse the word "Notepad" with "NOTETAB" and they are as different as night and day. I have written them differently in an attempt to make the difference more obvious.



      BACKGROUND STUFF FOR NEWBIES:
      ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯

      Win95 thru WinXP comes with a small basic text editor called Notepad.exe.

      This editor is provided for the viewing and editing of .txt, .ini, .dat, .cfg, .html and other similar type text files.

      As editor programs go, it is small, quick, and don't use a lot of resources but at the same time it is not overly sophisticated and does not allow viewing or editing more than 1 file at a time.

      By default, In Win95 thru WinXP Notepad.exe is associated to the basic text file extensions and is the default editor for the Internet Explorer.

      Notepad is the default editor unless the file is too large for Notepad and then Windows asks to default to Wordpad, a little more sophisticated editor which is capable of handling larger files than Notepad.exe.

      If one opens the Windows Explorer and double Left clicks on a file with a .txt extension (such as Readme.txt) then "By Association" Notepad.exe will automatically be launched and the file will automatically be opened in Notepad.exe.

      Likewise if one is viewing a Web page in the Internet Explorer and desires to view it as formatted text in a text editor, then right clicking and selecting "View Source" will automatically launch Notepad.exe and the file will automatically be opened in Notepad.exe.

      This is all fine and dandy if you want to view and edit "Plain Text" (non formatted text) files in Notepad.exe.

      Most people who edit text files have purchased a more sophisticated editor and would prefer to use it in place of Notepad.exe.

      This is not a major problem until you desire to open the above type text files and use your preferred editor as the default editor in the Internet Explorer and other applications which shell out to an editor.

      The information that is used by Windows to determine which application is to be used to OPEN, EDIT, and PRINT files of a given extension resides in the Windows Registry file which is essentially a large parameter file.

      Many User Applications will change the registry for you if you tell it which extensions you would like to have associated with that particular application.

      Likewise, in the Windows Folder Options it is possible to define which application you would like to have associated with a given extension.

      If one has a good understanding of the workings of the registry then it is also possible using Regedit.exe to edit the registry file directly and make all of the necessary changes right in the registry itself.

      Using one or all of these methods one can then customize their computer to have their preferred editor open "By Association" for any given text file extension they choose.

      This then leads one to ask the question:


      WHY DO I WANT TO REPLACE Notepad WITH NOTETAB?
      ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯

      Notepad is the default editor for Windows and is associated to all of the standard plain text file extensions and is as well the default editor for the Windows Internet Explorer Browser.

      Also, it is often desired to shell out of a third party application into a text editor. These applications usually either shell out to Notepad directly, or to the Windows default editor. (Some offer the option of shelling out to their own editor, Notepad, or "Other", and if "Other" is selected, it usually requires that the editor be placed in the same directory as the application.)

      In the NOTETAB Help Menu is the Option to "REPLACE Notepad WITH NOTETAB". Simply by invoking this option, ALL calls for Notepad will cause NOTETAB to be launched instead.

      By simply letting windows and all of our applications THINK THAT THEY ARE STILL USING Notepad.exe, YET have them actually launch NOTETAB instead, then we can bypass all of the above association and registry problems and let windows and all of our applications use WHAT THEY THINK IS Notepad.exe as their default editor and THEY WILL BE HAPPY, and we will be able to work in NOTETAB AND WE WILL BE HAPPY.

      Any NEW ASSOCIATIONS we want to make can be associated to Notepad.exe and WE NEVER HAVE TO WORRY.

      If we decide for some reason that we want to use Notepad.exe, we can from the NOTETAB Help menu simply reverse the above using the "RESTORE Notepad" and revert back to Notepad as the real default editor.

      If you want NOTETAB to be your default editor for Windows, and elect instead to make changes to the registry and in your application's configuration files to accomplish this, then you have to find every instance in the registry and in your application's configuration files where Notepad is called and change it to NOTETAB. This is a very time consuming task and if not done properly can lead to many undesired results. It is also equally difficult to reverse the process.

      WHAT IS INVOLVED WITH REPLACING Notepad WITH NOTETAB?
      ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯

      To fake out Windows and any other application, and make it use NOTETAB as the default editor we have to replace the copy of Notepad.exe that Windows would ordinarily launch, with a new file also called Notepad.exe which redirects Windows to NOTETAB via information it reads from an .ini file.

      We must also preserve the original Notepad.exe in the event that for some reason we desire to use it or to revert back to it as the default editor.

      NOTE:
      The only reason I have heard of to date for using Notepad in Win2K and WinXP instead of NOTETAB is to edit UNICODE .reg files.


      HOW IS IT DONE IN Win9X and WinME?
      ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯

      In Win9X and WinME, the Notepad.exe file that Windows launches as it's default editor is in the C:\WINDOWS directory.

      When you install NOTETAB you will find in the NOTETAB directory 2 files which are used to replace Notepad.exe.

      These files are:

      Notepad.stb
      Notepad.ini (this file gets created by NOTETAB when this procedure is performed)


      Notepad.stb is really a .exe file that has had the extension changed so that it doesn't accidently get launched.

      Notepad.ini is an initialization file used by Notepad.stb which contains the path and filename of the version of NOTETAB that you are using.


      In NOTETAB's Help menu is the option "REPLACE Notepad WITH NOTETAB".

      When this option is selected, NOTETAB does the following:


      Renames the copy of Notepad.exe in the C:\WINDOWS directory to Notepad.EXE.MS

      Copies Notepad.stb and Notepad.ini to the C:\WINDOWS directory

      Renames the copy of Notepad.stb in the C:\WINDOWS directory to Notepad.exe


      Windows still thinks it is using Notepad.exe but in fact Notepad.stb (now called Notepad.exe) is looking at Notepad.ini and running the file specified in it.

      Now, if we look in the NOTETAB Help menu the option is changed to "RESTORE Notepad" and when selected the above process is essentially reversed and the original Notepad.exe is restored as Notepad.exe and the real Notepad.exe is once again the Windows default editor.




      HOW IS IT DONE IN WIN2K and WinXP?
      ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
      In the below it is important to know that when you install Win2k all of the Windows files are in the directory C:\WINNT instad of C:\WINDOWS as they are in Win98.

      When installing WinXP all of The Windows files are still in C:\WINNT if you install WinXP over Win2K or are in C:\WINDOWS if you installed Winxp to a clean freshly formatted drive.

      The procedure to "REPLACE Notepad WITH NOTETAB" is identical to the above with one exception.

      The "Windows File Protection System" (WFP) which is new with Win2K and WinXP protects one of the files that must be changed and you can only over-ride it manually.


      WHAT YOU MUST DO MANUALLY
      ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
      In Win2K, the Notepad.exe file that Windows launches as it's default editor is in the C:\WINNT\SYSTEM32 directory. Depending on how you installed WinXP the path for the Notepad.exe directory will vary. It will be either C:\WINNT\system32 OR C:\WINDOWS\system32

      A copy is also in the "special backup" C:\WINNT\SYSTEM32\dllcache directory which is used by the new "Windows File Protection System" to repair/restore the other one should it become damaged/lost/deleted or should someone try to rename it.

      YOU MUST MANUALLY RENAME/DELETE THIS FILE TO OVER-RIDE THE WINDOWS FILE PROTECTION SYSTEM!!

      The only real trick here is to find the C:\WINNT\SYSTEM32\dllcache
      directory which is a HIDDEN and PROTECTED "OPERATING SYSTEM" directory, and
      requires that you goto:

      NOTE: There are 2 things that must be done here, not just 1.

      MY COMPUTER>TOOLS>FOLDER OPTIONS>VIEW

      AND SELECT
      "Show hidden files and folders"

      AND UNCHECK
      "Hide protected operating system files"

      This will allow you to find it with the Explorer (There are other ways to
      find it but this is a sure way)

      NOTE:
      Depending on how you installed Win2K and WinXP the path for the dllcache
      directory will vary. It will be either C:\WINNT\system32\dllcache OR C:\WINDOWS\system32\dllcache

      Fortunately the "Windows File Protection System" allows us to manually override it and we can change the file extensions if we really want to.

      Attempting to rename these files will bring up the Windows File Protection dialog box.

      When you do MANUALLY rename/delete C:\WINNT\SYSTEM32\dllcache\Notepad.exe,
      it will invoke the WFP prompt.

      NOTE:
      It may not immediately invoke the WFP prompt. Due to the way the WFP works,
      it can be several minutes before the prompt automatically appears. As well
      it may be hidden behind other screens. Just watch the Task bar and
      eventually a WFP tab will appear and will be blinking to let you know that the Windows file protection is active. Then look for the prompt. Attempting to use the REPLACE/RESTORE commands in the
      NOTETAB HELP menu should force the prompt to appear. It is possible too
      that the prompt will appear more than once when the REPLACE command in the
      NOTETAB HELP menu is used. Just answer each in the prescribed manner.

      The dialog box may be hidden behind other windows on your screen and it might have a 5 second or so delay in appearing. The task bar box will also flash a few times

      When it does appear (or you find it behind another screen) click CANCEL

      It will then prompt that you chose NOT to restore original versions (You have to read this carefully). At the prompt Click YES.

      You must make changes in the "special backup" C:\WINNT\SYSTEM32\dllcache directory before you make changes in the C:\WINNT\SYSTEM32 directory else it will automatically undo your changes in the C:\WINNT\SYSTEM32 directory.


      WHAT NOTETAB DOES AUTOMATICALLY
      ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
      When you install NOTETAB 4.86 you will find in the NOTETAB directory 2 files which are used to replace Notepad.exe.

      These files are:

      Notepad.stb
      Notepad.ini (this file gets created by NOTETAB when this procedure is performed)


      Notepad.stb is really a .exe file that has had the extension changed so that it doesn't accidently get launched.

      Notepad.ini is an initialization file used by Notepad.stb which contains the path and filename of the version of NOTETAB that you are using.


      In NOTETAB's Help menu is the option "REPLACE Notepad WITH NOTETAB".

      When this option is selected, NOTETAB does the following:


      Renames the copy of Notepad.exe in the C:\WINNT directory to Notepad.EXE.MS

      Copies Notepad.stb and Notepad.ini to the C:\WINNT directory

      Renames the copy of Notepad.stb in the C:\WINNT directory to Notepad.exe


      Windows still thinks it is using Notepad.exe but in fact Notepad.stb (now called Notepad.exe) is looking at Notepad.ini and running the file specified in it.

      Now, if we look in the NOTETAB Help menu the option is changed to "RESTORE Notepad" and when selected the above process is essentially reversed and the original Notepad.exe is restored as Notepad.exe and the real Notepad.exe is once again the Windows default editor.


      NOTE:

      If you have about 10 minutes to spare, goto:

      http://support.microsoft.com/servicedesks/webcasts/so_projects/so3/so3.asp?fr=1

      for a pretty good audio video presentation on WFP.


      Please report any corrections, additions, omissions, or unexpected results found in this document to:


      Jim Hall

      =======================
      To do this at work
      ========================
      The culprit is the WFP (in 2K and XP) which is the new Windows File Protection Scheme which makes it impossible for a software install to overwrite or delete any system files (Notepad is one that is protected).

      It is possible to defeat it and that is what you have to do to replace Notepad with NoteTab and yes it affects everyone and in some respects leaves the system vulnerable (new 2K or XP applications wouldn't try to overwrite them but some of the older aps used to)

      The solution for you is to keep it all in your user.dat file and then it will only work when you are logged on.

      The easiest way to do this is to go to NTP OPTIONS>ASSOCIATIONS and enter the extensions for the files you deal with. This will change YOUR associations in YOUR profile USER.DAT file.

      HOWEVER, this will not let you view source from IE in NoteTab (If that is important for you). For this you either have to use regedit or Erics clip (in one of the default clip libraries that comes with NTP maybe utilities, or one of the HTML libraries - I don't have them all loaded on this machine so I can't look) and change the IE default editor in your CURRENT USER registry entry for the IE default editor.

      I'm at the shop right now and have no archives to get more details from.

      If you can't figure it out from this, let me know and I'll send more details from the house.


      ======================= Resulting in Clueless's batch file:

      Rename C:\Windows\NOTEPAD.EXE NOTEPAD.EXE.MS
      COPY "C:\Program Files\NoteTab Pro\NOTEPAD.STB" C:\Windows\NOTEPAD.EXE Start /Wait "C:\Program Files\NoteTab Pro\NotePro.exe"
      Del C:\Windows\NOTEPAD.EXE Rename C:\Windows\NOTEPAD.EXE.MS NOTEPAD.EXE
      =============================
    Your message has been successfully submitted and would be delivered to recipients shortly.