Hi Arthur, thank you for forcing me on this task. I want to do this for some months now on my own.
To replace Notepad with an other editor
you have to replace "C:\Windows\Notepad.exe"
with an little app who redirects the launch of notepd to an other (third) app.
A program who do this nicely (with XP) is ProgLauncher
Notepad.exe will be replaced with ProgLauncher.exe
and there will be an config file where you can add the path to the editor of your choice.
Since there is a windows file protection you have do this with an trick.
The easiest trick is to replace all notepad.exe's in the relevant places at once.
For this you can use my batch
To replace notepad on XP do this:
0.) make an backup of your C: -Partition
It works for me. Tomorrow i will do some more test on an other test pc.
1.) Download ProgLauncher from
http://phi.lho.free.fr/softwares/PhiLhoSoft/freewares/Freewares.en.html2.) unpack the downloaded archive
3.) modify the file "notepad.cfg"
The first three lines should look like
e:\a\HippoEDIT\HippoEdit.exe
"*"
.As you see, put in the first line your path to HippoEDIT.exe
4.) in the same folder as the ProgLauncher.exe is
create a new file, called like "_replace_origNotepad_w_HippoEDIT.cmd"
5.) Copy the following code in this new file
_replace_origNotepad_w_HippoEDIT.cmd
@ECHO OFF
ren %windir%\ServicePackFiles\i386\notepad.exe notepad-original.exe
ren %windir%\system32\dllcache\notepad.exe notepad-original.exe
ren %windir%\system32\notepad.exe notepad-original.exe
ren %windir%\notepad.exe notepad-original.exe
copy ProgLauncher.exe %windir%\ServicePackFiles\i386\notepad.exe
copy ProgLauncher.exe %windir%\system32\dllcache\notepad.exe
copy ProgLauncher.exe %windir%\system32\notepad.exe
copy ProgLauncher.exe %windir%\notepad.exe
copy NotePad.cfg %windir%\System32\NotePad.cfg
pause EDIT:
i put NotePad.cfg now in %windir%\System32\ instead of %windir%\ , because
CLASSES_\txtfile and all others say "%SystemRoot%\system32\notepad.exe" too on XP (that mean notepad is started from C:\Windows\System32)
(curios what %WinDir% and %SystemRoot% means? Open DOS-Box (run cmd) and type set and press enter)
6.) run this batch
7.) done
To undo this, use this batch
@ECHO OFF
copy %windir%\notepad-original.exe %windir%\ServicePackFiles\i386\notepad.exe
copy %windir%\notepad-original.exe %windir%\system32\dllcache\notepad.exe
copy %windir%\notepad-original.exe %windir%\system32\notepad.exe
copy %windir%\notepad-original.exe %windir%\notepad.exe
pause I will build an archive with all files and infos.
Or better i will write an tool who do this all on its own?
To let an user execute this tool from the current HippoEDIT folder, to:
- rename all original notepad.exe
- copy redirect-tool to %WinDir%
- build an config file in %WinDir%, already set with the current working dir (while launched from HippoEDIT folder)
?
-------------------
I have made this simple AHK script.
It does the same as the batch, but create the NotePad.cfg on the fly and fill in the actual dir as path for HippoEDIT.exe
If you want use on your own risk. It is tested only on XP. There are right now no error detections.
This just renames the original notepad.exe and copy ProgLauncher.exe as new notepad.exe.
You have to run this with admin rights
and from inside the folder where the HippoEDIT.exe is, because this is used as path written to the NotePad.cfg
You need the ProgLauncher.exe in this folder too because it is copied from there.
LaunchHippoEDITinsteadOfNotepad.ahk
#SingleInstance force
Run %comspec% /c "ren %windir%\ServicePackFiles\i386\notepad.exe notepad-original-HippoEDIT.exe",,Hide
Run %comspec% /c "ren %windir%\system32\dllcache\notepad.exe notepad-original-HippoEDIT.exe",,Hide
Run %comspec% /c "ren %windir%\system32\notepad.exe notepad-original-HippoEDIT.exe",,Hide
Run %comspec% /c "ren %windir%\notepad.exe notepad-original-HippoEDIT.exe",,Hide
Run %comspec% /c "copy ProgLauncher.exe %windir%\ServicePackFiles\i386\notepad.exe",,Hide
Run %comspec% /c "copy ProgLauncher.exe %windir%\system32\dllcache\notepad.exe ",,Hide
Run %comspec% /c "copy ProgLauncher.exe %windir%\system32\notepad.exe",,Hide
Run %comspec% /c "copy ProgLauncher.exe %windir%\notepad.exe ",,Hide
FileDelete, %windir%\NotePad.cfg
FileDelete, %windir%\System32\NotePad.cfg
FileAppend , %A_WorkingDir%\HippoEDIT.exe`n"*"`n.`n, %windir%\NotePad.cfg
FileAppend , %A_WorkingDir%\HippoEDIT.exe`n"*"`n.`n, %windir%\System32\NotePad.cfg
Exit
RestoreNotepad.ahk
#SingleInstance force
Run %comspec% /c "copy %windir%\ServicePackFiles\i386\notepad-original.exe %windir%\ServicePackFiles\i386\notepadnotepad.exe",,Hide
Run %comspec% /c "copy %windir%\system32\dllcache\notepad-original.exe %windir%\system32\dllcache\notepad.exe",,Hide
Run %comspec% /c "copy %windir%\system32\notepad-original.exe %windir%\system32\notepad.exe",,Hide
Run %comspec% /c "copy %windir%\notepad-original.exe %windir%\notepad.exe",,Hide
FileDelete, %windir%\NotePad.cfg
FileDelete, %windir%\System32\NotePad.cfg
Exit
I want to attach the compiled scripts, but they are 200k each, what is to much in size and not allowed to attach.
.