Notepad2 as Vista Notepad Replacement Install Script

Discussion in 'Windows Vista' started by admin, May 5, 2007.

  1. admin

    admin Administrator
    Staff Member

    Apr 24, 2007
    229
    99
    10
    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.
     
  2. Rudi1

    Rudi1 MDL Member

    May 30, 2007
    207
    67
    10
    Thanx,works like a sharm!:)
     
  3. YUMYUM9x

    YUMYUM9x MDL Novice

    May 20, 2007
    19
    0
    0
    #3 YUMYUM9x, Jul 28, 2007
    Last edited by a moderator: Apr 20, 2017
    good job! /thanks ;)






    InstallNotepad2.bat v1.1 :p

    Code:
    @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.net)
    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

    Code:
    @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.net)
    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
    
    
    
     
  4. vee

    vee MDL Novice

    Aug 2, 2007
    1
    0
    0
    InstallNotepad2 script doesn't work

    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
     
  5. RockAndRollProgrammer

    May 28, 2008
    1
    0
    0
    Problems with Vista Ultimate in domain

    :(
    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.
     
  6. reginakampher

    reginakampher MDL Addicted

    Apr 5, 2008
    678
    149
    30
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  7. notsoguru

    notsoguru MDL Novice

    Jul 4, 2008
    1
    0
    0
    ty

    :cool: wow this really worked for me thank you can't wait till Microsoft adds it to the future OS's
     
  8. ctrlatldel

    ctrlatldel MDL Novice

    Jul 8, 2008
    1
    0
    0
    Im just getting a .txt file and its opening in notepad.. im going nuts, help me please
     
  9. reginakampher

    reginakampher MDL Addicted

    Apr 5, 2008
    678
    149
    30
    #9 reginakampher, Jul 8, 2008
    Last edited by a moderator: May 23, 2017
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  10. AssassinWarrior

    AssassinWarrior MDL Novice

    Nov 19, 2008
    1
    0
    0
    wow thanks for the script, :)
     
  11. Rudi1

    Rudi1 MDL Member

    May 30, 2007
    207
    67
    10
    Now the windows 7 beta is laked,so I like to ask if you can update this nice script to work for windows 7? :)
     
  12. juzz

    juzz MDL Member

    Jun 28, 2008
    132
    5
    10
    #12 juzz, Jan 11, 2009
    Last edited by a moderator: Apr 20, 2017
    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
    Code:
    @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.net)
    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
     
  13. Rudi1

    Rudi1 MDL Member

    May 30, 2007
    207
    67
    10
    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!
     
  14. lucamanta

    lucamanta MDL Novice

    Feb 16, 2010
    1
    0
    0
    didn't managed to install it using the auto installer, i had to do it the "hard way", manually, by changing user rights...thx to reginakampher
     
  15. juzz

    juzz MDL Member

    Jun 28, 2008
    132
    5
    10
    Did you run it as administarator?

    "save to .bat file and run as administrator (right click menu)"

    If you just double click .bat file it won't work even if you have administrator rights with your user. At least if I remember correctly. Long time since I tried this last time :)

    And also if you tried it on win7 make sure you had the modified version from my earlier post. Original .bat didn't work with win7 beta/RC/(final?).
     
  16. LauraE

    LauraE MDL Novice

    Mar 5, 2010
    1
    0
    0
    What is the bcdedit line for ( I left it out, and seems ok)

    3/3/10 date of my post... I left out the bcdedit line because I could not easily research what this would do. Also not comfortable with editing boot-related "stuff". But everything seems to work just fine without this line.

    Anyone see any problems with leaving out the bcdedit line in the install script?