Archives par mot-clé : remplacer

Remplacer notepad par notepad2 en 1 script

Je viens de trouver le script qui me manquai pour remplacer automatiquement notepad par notepad2.

1 / Télécharger notepad2

2 / Décompresser le fichier

3 / Dans le repertoire où est décompressé notepad2 creer un nouveau fichier notepad2.bat.

4 / Dans ce fichier rentrer ces instructions :

@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

Enregistrer puis quitter le fichier notepad.bat

5 / Double cliquez sur le fichier notepad.bat

6 / Suivez la procédure qui s’affiche (appuyé sur ENTER)

7 / Windows vous informe que notepad a été modifié. Faite annuler puis OK.

Enjoy Source