Notepad replacement

2008-04-12
2013-03-10
  • Nobody/Anonymous

    Hi

    I followed the instructions on the Notepad ++ site to totaly replace notepad will notepad++. As soon as I have copied the new notepadd++ exe file to replace the old notepad file in the folowing directories

       * Copy notepad.exe which comes with this package into 3 directories (in given order) :
             1. c:\windows\system32\dllcache
             2. c:\windows\system32
             3. c:\windows

    Windows seems to somehow replace the notepad++ file with the old notepad file.

    Anyway if anyone knows why this is hapening and what I can do about it it would be appreciated.

    From
    Melch

     
    • Nobody/Anonymous

      This happen by the Windows XP file protection system!
      I made (with AutoIt) a Notepad++ Replacer with a GUI for replacing MS-Notepad.exe with the N++ Launcher, that temporary disables Protection for MS-Notepad.exe.

      Here is a screen NPP-GUI_eng.jpg:
      http://s3.directupload.net/file/d/1257/o8qhbanz_jpg.htm
      Here you can download the file Notepad-Replacer_eng.exe:
      http://uploaded.to/?id=mebyye
      Here you can download the scriptfile *.au3, if you would like to compile by yourself:
      http://uploaded.to/?id=rnb6d3
      AutoIt Script home page http://www.autoitscript.com/

      Extract i.E. in Notepad++ dir and run the Notepad-Replacer_eng.exe.

      How it goes:
      - it extracts to temp: n++_icon, n++_logo.gif, n++launcher and setup.exe
        and run the setup.exe
      - it requires Adminrights! in WinXP
      - if a open session of the MS-Notepad.exe excist, will close in 20 sec.
      - it makes a backup from the MS-Notepad.exe in 'Windir/Notepad-backup'
      - it looks where the MS-Notepad.exe stored:
          WindowsDir\servicepackfiles\i386\notepad.exe
          WindowsDir\source\WinXP\i386\notepad.exe
          WindowsDir\notepad.exe
          SystemDir\dllcache\notepad.exe
          SystemDir\notepad.exe
          HomeDrive\i386\notepad.exe
          HomeDrive\i386\notepad.ex_
      - it temporary disables Protection for MS-Notepad.exe and
        replace it with the Notepad++ Launcher in given dir.
      - it writes a logfile Notepad.log, where the script starts.

      So have fun.

       
    • Mattes H.

      Mattes H. - 2013-03-10

      Hi,
      you may want to use an easier was for your WinXP, Vista, Win7, Win8 system:
      https://sourceforge.net/projects/npplauncher/
      I used the method with rerouting the call in registry.
      It makes a blocking call, so that batch scripts are stop as with notepad.exe.
      Feel free to comment on my project page.
      Mattes H.

       
  • EccentricEgg

    EccentricEgg - 2009-10-12

    I haven't tried Notepad-Replacer_eng.exe but have often installed NPPLauncher replacing the files in this order (the reverse of the instructions above) with great success:

    1. c:\windows
    2. c:\windows\system32
    3. c:\windows\system32\dllcache

    I think an AutoIt program should work well, but I sometimes get antivirus alerts with AutoIt-based programs (using AVG antivirus btw), so I tend to avoid them from (no offense) unknown authors. I do know that Toshiba uses AutoIt from some of its tools but for whatever reason I've never had a false positive virus alert from any of them. I actually have, in the past, had trouble even installing AutoIt itself due to antivirus alerts, but I digress…

    If the Notepad-Replacer_eng.exe is not your cup of tea try reversing the order in which you replace notepad.exe.

    Good Luck

     
  • Mike Hanewinckel

    Instead of trying to overwrite it is much easier to add a single registry key that will redirect all attempts to edit notepad.exe

    I think they call it an image hijack. I tried it works great. I didn't have to overwrite anything. I am running 64-bit windows. Don't know if 32-bit uses a different registry entry. Here is the key:

    [HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\notepad.exe]
    "Debugger"="\"C:\\Program Files (x86)\\Notepad++\\notepad++.exe\""
    
     
  • MRuth

    MRuth - 2011-11-22

    Use the Registry version found on the main replacement page, but replace the VB Script text with the text below…..

    Option Explicit
    dim objShell
    Dim Filename
    'Make Sure that the Registry value points to the script file!!!

    'Default Location for Notepad++ executable.
    'For Best Results place this script in the same folder as exe and leave as default.
    Filename = "Notepad++.exe"

    If WScript.Arguments.Count = 3 Then
    Filename = Filename + " " + chr(34) + WScript.Arguments(1) + " " + WScript.Arguments(2) + chr(34)
    End If
    Set objShell = WScript.CreateObject("WScript.Shell")
    objShell.Run(Filename)
    Set objShell = Nothing
    WScript.Quit