PDA

View Full Version : Notepad2 as Vista Notepad Replacement Install Script


admin
05-05-2007, 11:20 AM
Use this script to automatically install Notepad2 and set it to replace Notepad as default text editor in Windows Vista.

Usage instruction can be found here (http://www.mydigitallife.info/2007/05/05/auto-install-script-for-notepad2-in-vista-to-replace-notepad/).

Rudi1
07-27-2007, 09:15 PM
Thanx,works like a sharm!:)

YUMYUM9x
07-28-2007, 10:15 PM
good job! /thanks ;)






InstallNotepad2.bat v1.1 :p


@echo off
TITLE Notepad2 Install Script for Complete Vista Notepad Replacement
echo.
echo Notepad2 Install Script for Complete Vista Notepad Replacement
echo Version 1.1
echo.
echo (c) My Digital Life (www.mydigitallife.info)
echo.
echo.
echo.
echo Confirm to apply? (Press Ctrl-C and answer Y to terminate)
pause
echo.
echo.

if exist %Systemroot%\notepad.original.exe goto exist_notepad2_already
if exist %Systemroot%\System32\notepad.original.exe goto exist_notepad2_already
takeown /f %Systemroot%\notepad.exe
takeown /f %Systemroot%\System32\notepad.exe
icacls %Systemroot%\notepad.exe /grant "%username%":f
icacls %Systemroot%\System32\notepad.exe /grant "%username%":f
IF EXIST %SYSTEMROOT%\SysWOW64 (bcdedit.exe -set loadoptions "DDISABLE_INTEGRITY_CHECKS")
copy %Systemroot%\notepad.exe %Systemroot%\notepad.original.exe
copy %Systemroot%\System32\notepad.exe %Systemroot%\System32\notepad.original.exe
echo.
echo Original notepad.exe has been renamed to "notepad.original.exe" in its original folder.
echo.
copy notepad2.exe %Systemroot%\notepad.exe /y
copy notepad2.exe %systemroot%\System32\notepad.exe /y
echo.
echo Notepad2 installation is completed.
echo If no error occurred, Notepad2 will now replace all Notepad functions.
echo.
pause
exit

:exist_notepad2_already
echo.
echo INSTALLED NOTEPAD2 ALREADY!.
echo.
pause
exit





UninstallNotepad2.bat v1.1 :p


@echo off
TITLE Notepad2 UnInstall Script for Complete Vista Notepad Replacement
echo.
echo Notepad2 UnInstall Script for Complete Vista Notepad Replacement
echo Version 1.1
echo.
echo (c) My Digital Life (www.mydigitallife.info)
echo.
echo.
echo.
echo Confirm to apply? (Press Ctrl-C and answer Y to terminate)
pause
echo.
echo.

if not exist %Systemroot%\notepad.original.exe goto not_exist_notepad2
if not exist %Systemroot%\System32\notepad.original.exe goto not_exist_notepad2
takeown /f %Systemroot%\notepad.exe
takeown /f %Systemroot%\System32\notepad.exe
icacls %Systemroot%\notepad.exe /grant "%username%":f
icacls %Systemroot%\System32\notepad.exe /grant "%username%":f
IF EXIST %SYSTEMROOT%\SysWOW64 (bcdedit.exe -set loadoptions "DDISABLE_INTEGRITY_CHECKS")
del %Systemroot%\notepad.exe
del %Systemroot%\System32\notepad.exe
echo.
echo notepad.exe(notepad2) has been deleted.
echo.
ren %Systemroot%\notepad.original.exe notepad.exe
ren %Systemroot%\System32\notepad.original.exe notepad.exe
echo.
echo Original notepad.original.exe has been renamed to "notepad.exe" in its original folder.
echo.
echo Notepad2 uninstallation is completed.
echo.
goto exit_uninstall

:not_exist_notepad2
echo.
echo ERROR NOTEPAD2 NOT EXIST or NOT INSTALL.
goto exit_uninstall

:exit_uninstall
pause

vee
08-02-2007, 03:11 PM
Hallo everyone,

After running the script I see In the Windows Map the files:
notepad.original.exe and also notepad.exe but notepad.exe is the original Windows Vista notepad text editor and not the "notpad2" one.
I see the same files in Windows\system32 as in the Windows map.:(

vee

RockAndRollProgrammer
05-28-2008, 06:58 PM
:(
I have tried with no success to perform this same feat on my work laptop. I just can't seem to get access to the System32 copy of notepad.exe. I think it has something to do with my role in our domain.

reginakampher
05-29-2008, 01:29 AM
You can also do it manually.

http://www.flos-freeware.ch/zip/notepad2.zip


1. Download and extract Notepad2.
2. Rename Notepad2.exe to notepad.exe.
3. Find c:\windows\notepad.exe and c:\windows\system32\notepad.exe and set
the owner to ‘Administrators’, and grant Administrators full control.
4. Using Windows Explorer, drag and drop the renamed notepad2.exe to c:\windows and c:\windows\system32.

notsoguru
07-04-2008, 08:09 PM
:cool: wow this really worked for me thank you can't wait till Microsoft adds it to the future OS's

ctrlatldel
07-08-2008, 08:41 PM
Im just getting a .txt file and its opening in notepad.. im going nuts, help me please

reginakampher
07-08-2008, 09:16 PM
Did you try doing it manually?

http://forums.mydigitallife.info/showpost.php?p=27706&postcount=6

AssassinWarrior
11-19-2008, 05:41 AM
wow thanks for the script, :)

Rudi1
01-10-2009, 08:49 PM
Now the windows 7 beta is laked,so I like to ask if you can update this nice script to work for windows 7? :)

juzz
01-11-2009, 10:26 PM
Now the windows 7 beta is laked,so I like to ask if you can update this nice script to work for windows 7? :)Current bat works if you browse to directory with command prompt (admin rights) and run bat with it.


If you run .bat from directory it doesn't work because of windows 7 seems to think it is ran from c:windows\system32 and cannot copy notepad2.exe because of it isn't there. I'm trying to find solution atm for better .bat file :)


EDIT: OK found way to make it work properly with win7:

save to .bat file and run as administrator (right click menu). You can edit original .bat file found from earlier posts


InstallNotepad2.bat v1.2 :P
@echo off
TITLE Notepad2 Install Script for Complete Windows Vista and 7 Notepad Replacement
echo.
echo Notepad2 Install Script for Complete Windows Vista and 7 Notepad Replacement
echo Version 1.2
echo.
echo (c) My Digital Life (www.mydigitallife.info)
echo.
echo.
echo.
echo Confirm to apply? (Press Ctrl-C and answer Y to terminate)
pause
echo.
echo.

if exist %Systemroot%\notepad.original.exe goto exist_notepad2_already
if exist %Systemroot%\System32\notepad.original.exe goto exist_notepad2_already
takeown /f %Systemroot%\notepad.exe
takeown /f %Systemroot%\System32\notepad.exe
icacls %Systemroot%\notepad.exe /grant "%username%":f
icacls %Systemroot%\System32\notepad.exe /grant "%username%":f
IF EXIST %SYSTEMROOT%\SysWOW64 (bcdedit.exe -set loadoptions "DDISABLE_INTEGRITY_CHECKS")
copy %Systemroot%\notepad.exe %Systemroot%\notepad.original.exe
copy %Systemroot%\System32\notepad.exe %Systemroot%\System32\notepad.original.exe
echo.
echo Original notepad.exe has been renamed to "notepad.original.exe" in its original folder.
echo.
copy %~dp0\notepad2.exe %Systemroot%\notepad.exe /y
copy %~dp0\notepad2.exe %systemroot%\System32\notepad.exe /y
echo.
echo Notepad2 installation is completed.
echo If no error occurred, Notepad2 will now replace all Notepad functions.
echo.
pause
exit

:exist_notepad2_already
echo.
echo INSTALLED NOTEPAD2 ALREADY!.
echo.
pause
exit

Needs to be %~dp0\notepad2.exe :)

"%~dp0 is only available within a batch file and expands to the drive letter and path in which that batch file is located (which cannot change). It is obtained from %0 which is the batch file's name."

I test this one with my vista too after boot to make sure it still works with vista ;)

EDIT2: Seems to work with vista too. Enjoy. Credits to original authors. I just modified 2 lines and few echoes :P

Rudi1
01-11-2009, 11:05 PM
Thanx a lot juzz for your great work!!I try it and work like a sharm.For me notepad2 is the best notepad replacement,because for all I need I can do with it and when the windows7 is appear I really miss notepad2,now with your script I can use it again. :)

take care!

mcjohn87
08-10-2009, 02:31 AM
Interesting thought, i completely agree with your perspective
script install (http://globolstaff.com/)