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

Your comment:

Title:
Name:
Email:
Website:
 
Italic Underline Blockquote Hyperlink
 
 
Please add 1 and 8 and type the answer here:
 
Twitter