Replacing Notepad With Notepad2 on Windows XP SP3

One of my favorite utilities is Notepad2.  I had a script to replace the original Notepad with Notepad2 on Windows, but as of Windows XP Service Pack 3, that no longer works.

Luckily, I found this script from Travis:

@echo off
echo *IMPORTANT*
echo This will kill all open instances of Notepad.
echo To cancel, end this batch file now (ctrl+c), or hit any key to continue.
pause
echo Killing all instances of notepad running...
TASKKILL /F /IM notepad.exe /T
echo Backing up...
call :backup %systemroot%\servicepackfiles\i386
call :backup %systemroot%
call :backup %systemroot%\System32
call :backup %systemroot%\System32\dllcache
echo Installing...
copy notepad2.exe %systemroot%\servicepackfiles\i386\notepad.exe /y
copy notepad2.exe %systemroot%\notepad.exe /y
copy notepad2.exe %systemroot%\System32\notepad.exe /y
copy notepad2.exe %systemroot%\System32\dllcache\notepad.exe /y
echo Done.
pause
goto :end
:backup
call set npath=%1
set count=0
for %%i in (%npath%\notepad.original*.exe) do (
set nname=%%i
set /a count=count+1
)
echo backing up to %npath%\notepad.original%count%.exe
copy %npath%\notepad.exe %npath%\notepad.original%count%.exe /y
:end

Thanks Travis!

Print | posted @ Saturday, September 13, 2008 12:05 PM

Comments on this entry:

Gravatar # re: Replacing Notepad With Notepad2 on Windows XP SP3
by Russell Ball at 9/13/2008 3:55 PM

Very helpful. Thanks.
Gravatar # re: Replacing Notepad With Notepad2 on Windows XP SP3
by Kostas at 9/15/2008 3:09 PM

Very helpful.

Thank you.
Gravatar # re: Replacing Notepad With Notepad2 on Windows XP SP3
by Ben at 11/2/2008 1:09 AM

Very helpful batch file! Quick note that this batch file should be run from the *same* directory as Notepad2.exe

:)
Gravatar # re: Replacing Notepad With Notepad2 on Windows XP SP3
by Robz at 11/2/2008 1:42 AM

@Ben: Ah, yes. :D
Gravatar # re: Replacing Notepad With Notepad2 on Windows XP SP3
by BlackJoker at 1/30/2009 10:07 AM

DONE. GREAT!

Thank you very much guys ;)

P.S. As i see MS is against IMPROVEMENTS!.. instead of THAT they should learn a lot o f things... :}
Gravatar # re: Replacing Notepad With Notepad2 on Windows XP SP3
by sliuqin at 2/24/2009 8:09 PM

Thank you very much!
Gravatar # re: Replacing Notepad With Notepad2 on Windows XP SP3
by Louis at 4/30/2009 12:11 AM

I was able to do this simply by opening the 4 directories you indicated in 4 separate windows and just pasting the new Notepad.exe over top of each as quickly as possible.
Gravatar # re: Replacing Notepad With Notepad2 on Windows XP SP3
by Robz at 4/30/2009 9:04 PM

@Louis: That's like saying I inserted the data into the database by hand instead of using your application.

Cheers!
Gravatar # re: Replacing Notepad With Notepad2 on Windows XP SP3
by stefb12 at 7/4/2009 9:21 AM

Thanks a lot for sharing this!!
very useful - seems the old methods for SP2 were no longer working

Cheers!
Comments have been closed on this topic.