2 septembre 2016 5 02 /09 /septembre /2016 17:31
[DOS] Script de sauvegarde de profil Windows

@echo off title Sauvegarde de %computername% vers Machine de Geekers 77.56 color 0A :home cls echo. SET DATE=%date:/=-% REM set /p Login= Hi, Fournissez moi un compte admin sous la forme prenom.nom : REM set /p Pass= indiquer votre mot de passe echo cree par Geekers, en date du 02/09/2016 echo. echo Choisissez une tache: echo ===================================================== echo. echo 1) SAVE: Sauvegardes de Profil echo. echo 2) RESTORE: Restauration de Profil echo. echo ===================================================== echo. echo. set /p errorlevel=Type option: if "%errorlevel%"=="1" goto SAVE if "%errorlevel%"=="2" goto RESTORE :SAVE robocopy "%appdata%\microsoft\signatures" "\\192.168.77.56\D$\Sauvegardes\Save_Profils\%username%\%computername%\signatures" /e robocopy "%AppData%\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar" "\\192.168.77.56\D$\Sauvegardes\Save_Profils\%username%\%computername%\TaskBar" /e robocopy "%appdata%\microsoft\outlook" "\\192.168.77.56\D$\Sauvegardes\Save_Profils\%username%\%computername%\outlook" /e robocopy %userprofile%\Favorites\ \\192.168.77.56\D$\Sauvegardes\Save_Profils\%username%\%computername%\Favorites\ /e robocopy %userprofile%\downloads\ \\192.168.77.56\D$\Sauvegardes\Save_Profils\%username%\%computername%\downloads\ /e robocopy %userprofile%\pictures\ \\192.168.77.56\D$\Sauvegardes\Save_Profils\%username%\%computername%\pictures\ /e robocopy %userprofile%\videos\ \\192.168.77.56\D$\Sauvegardes\Save_Profils\%username%\%computername%\videos\ /e robocopy %userprofile%\music\ \\192.168.77.56\D$\Sauvegardes\Save_Profils\%username%\%computername%\music\ /e robocopy %userprofile%\virtual machines \\192.168.77.56\D$\Sauvegardes\Save_Profils\%username%\%computername%\virtual_machines\ /e robocopy %userprofile%\links\ \\192.168.77.56\D$\Sauvegardes\Save_Profils\%username%\%computername%\links\ /e robocopy %userprofile%\contacts\ \\192.168.77.56\D$\Sauvegardes\Save_Profils\%username%\%computername%\contacts\ /e robocopy %userprofile%\Desktop\ \\192.168.77.56\D$\Sauvegardes\Save_Profils\%username%\%computername%\desktop\ /e robocopy %userprofile%\Documents\ \\192.168.77.56\D$\Sauvegardes\Save_Profils\%username%\%computername%\Documents\ /e REM SAUVEGARDE D'ELEMENT DE LA BASE DE REGISTRE REG EXPORT "HKCU\Software\Microsoft\Office\12.0\Outlook" D:\Sauvegardes\Save_Profils\%username%\%computername%\OutCfg.reg REG EXPORT "HKCU\Software\Microsoft\Internet Explorer" D:\Sauvegardes\Save_Profils\%username%\%computername%\IECfg.reg REG EXPORT "HKCU\Network" D:\Sauvegardes\Save_Profils\%username%\%computername%\LctRsx.reg REG EXPORT "HKCU\Printers" D:\Sauvegardes\Save_Profils\%username%\%computername%\ImprRsx.reg REG EXPORT "HKCU\Software\Microsoft\Windows NT\CurrentVersion\Windows" D:\Sauvegardes\Save_Profils\%username%\%computername%\ImprDft.reg Echo FIN pause EXIT :RESTORE set /p Poste= indiquer le nom du PC d'origine: robocopy "\\192.168.77.56\D$\Sauvegardes\Save_Profils\%username%\%Poste%\signatures" "%appdata%\microsoft\signatures" /s /e /y /i robocopy "\\192.168.77.56\D$\Sauvegardes\Save_Profils\%username%\%Poste%\TaskBar" "%AppData%\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar" /s /e /y /i robocopy "\\192.168.77.56\D$\Sauvegardes\Save_Profils\%username%\%Poste%\outlook" "%appdata%\microsoft\outlook" /s /e /y /i robocopy \\192.168.77.56\D$\Sauvegardes\Save_Profils\%username%\%Poste%\Favorites\ %userprofile%\Favorites\ /e robocopy \\192.168.77.56\D$\Sauvegardes\Save_Profils\%username%\%Poste%\Favorites\ %userprofile%\Favoris\ /e robocopy \\192.168.77.56\D$\Sauvegardes\Save_Profils\%username%\%Poste%\downloads\ %userprofile%\downloads\ /e robocopy \\192.168.77.56\D$\Sauvegardes\Save_Profils\%username%\%Poste%\pictures\ %userprofile%\pictures\ /e robocopy \\192.168.77.56\D$\Sauvegardes\Save_Profils\%username%\%Poste%\videos\ %userprofile%\videos\ /e robocopy \\192.168.77.56\D$\Sauvegardes\Save_Profils\%username%\%Poste%\music\ %userprofile%\music\ /e robocopy \\192.168.77.56\D$\Sauvegardes\Save_Profils\%username%\%Poste%\virtual machines\ %userprofile%\virtual machines\ /e robocopy \\192.168.77.56\D$\Sauvegardes\Save_Profils\%username%\%Poste%\links\ %userprofile%\links\ /e robocopy \\192.168.77.56\D$\Sauvegardes\Save_Profils\%username%\%Poste%\saved games\ %userprofile%\saved games\ /e robocopy \\192.168.77.56\D$\Sauvegardes\Save_Profils\%username%\%Poste%\contacts\ %userprofile%\contacts\ /e robocopy \\192.168.77.56\D$\Sauvegardes\Save_Profils\%username%\%Poste%\desktop\ %userprofile%\Desktop\ /e robocopy \\192.168.77.56\D$\Sauvegardes\Save_Profils\%username%\%Poste%\My Documents\ %userprofile%\Documents\ /e REM REG IMPORT HKCU\Software\Microsoft\Office\12.0\Outlook" D:\Sauvegardes\Save_Profils\%username%\%computername%\OutCfg.reg REM REG IMPORT HKCU\Software\Microsoft\Internet Explorer" D:\Sauvegardes\Save_Profils\%username%\%computername%\IECfg.reg REM REG IMPORT HKCU\Network" D:\Sauvegardes\Save_Profils\%username%\%computername%\LctRsx.reg REM REG IMPORT HKCU\Printers" D:\Sauvegardes\Save_Profils\%username%\%computername%\ImprRsx.reg REM REG IMPORT HKCU\Software\Microsoft\Windows NT\CurrentVersion\Windows" D:\Sauvegardes\Save_Profils\%username%\%computername%\ImprDft.reg Echo FIN pause EXIT

Partager cet article

Repost 0
18 juin 2015 4 18 /06 /juin /2015 23:16

@echo off
Menu by GEEKERS : myster.geek@gmail.com
color 0c
:home
cls
echo.
rem set /p Login= Hi, Fournissez moi un compte admin sous la forme prenom.nom :
ECHO.
ECHO.
ECHO ###########################################################
ECHO # Script de sauvegardes et de restauration d'un poste #
ECHO # #
ECHO # Auteur d'origine : GEEKERS #
ECHO # Date de creation : 27/01/2015 #
ECHO # #
ECHO ###########################################################
ECHO.
ECHO.
ECHO.
echo Choisissez une tache:
echo ===============================================
echo.
echo 1) SAVE: sauvegardes du Profil local
echo 2) RESTORE: Restauration du Profil
ECHO.
ECHO.


set /p errorlevel=Type option:


if "%errorlevel%"=="1" goto SAVE
if "%errorlevel%"=="2" goto RESTORE


:SAVE
xcopy "%appdata%\microsoft\signatures" "\\SERVEUR\transferts\GEEKERS\sauvegardes\Save_Profils\%username%\signatures" /e /d /y /i /h
rem xcopy "%userprofile%" "\\SERVEUR\transferts\GEEKERS\sauvegardes\Save_Profils\%username%\profil" /s /e /d /y /i
xcopy "%AppData%\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar" "\\SERVEUR\transferts\GEEKERS\sauvegardes\Save_Profils\%username%\TaskBar" /s /e /d /y /i
xcopy "%appdata%\microsoft\outlook" "\\SERVEUR\transferts\GEEKERS\sauvegardes\Save_Profils\%username%\outlook" /e /d /y /i /h


XCOPY "%userprofile%\Favorites\"*.* "\\SERVEUR\transferts\GEEKERS\sauvegardes\Save_Profils\%username%\Favorites\" /S/Y
XCOPY "%userprofile%\downloads\"*.* "\\SERVEUR\transferts\GEEKERS\sauvegardes\Save_Profils\%username%\downloads\" /S/Y
XCOPY "%userprofile%\pictures\"*.* "\\SERVEUR\transferts\GEEKERS\sauvegardes\Save_Profils\%username%\pictures\" /S/Y
XCOPY "%userprofile%\videos\"*.* "\\SERVEUR\transferts\GEEKERS\sauvegardes\Save_Profils\%username%\videos\" /S/Y
XCOPY "%userprofile%\music\"*.* "\\SERVEUR\transferts\GEEKERS\sauvegardes\Save_Profils\%username%\music\" /S/Y
XCOPY "%userprofile%\virtual machines"\"*.* "\\SERVEUR\transferts\GEEKERS\sauvegardes\Save_Profils\%username%\"virtual machines"\" /S/Y
XCOPY "%userprofile%\links\"*.* "\\SERVEUR\transferts\GEEKERS\sauvegardes\Save_Profils\%username%\links\" /S/Y
XCOPY "%userprofile%\"saved games"\*.* "\\SERVEUR\transferts\GEEKERS\sauvegardes\Save_Profils\%username%\"saved games"\" /S/Y
XCOPY "%userprofile%\contacts\"*.* "\\SERVEUR\transferts\GEEKERS\sauvegardes\Save_Profils\%username%\contacts\" /S/Y
XCOPY "%userprofile%\Desktop\"*.* "\\SERVEUR\transferts\GEEKERS\sauvegardes\Save_Profils\%username%\desktop\" /S/Y
XCOPY "%userprofile%\Documents\"*.* "\\SERVEUR\transferts\GEEKERS\sauvegardes\Save_Profils\%username%\"My Documents"\" /S/Y
XCOPY "%localappdata%\Microsoft\Outlook\"*.pst "\\SERVEUR\transferts\GEEKERS\sauvegardes\Save_Profils\%username%\"Outlook PST"\" /S/Y
XCOPY "%appdata%"\Microsoft\Signatures\*.* "\\SERVEUR\transferts\GEEKERS\sauvegardes\Save_Profils\%username%\"Outlook Signature"\" /S/Y
XCOPY "%appdata%"\Microsoft\Outlook\*.* "\\SERVEUR\transferts\GEEKERS\sauvegardes\Save_Profils\%username%\outlook_name\" /S/Y


REGEDIT /S /e \\SERVEUR\transferts\GEEKERS\\sauvegardes\Save_Profils\%username%\%Poste%\\OutCfg.reg "HKEY_CURRENT_USER\Software\Microsoft\Office\11.0\Outlook"
REGEDIT /S /e \\SERVEUR\transferts\GEEKERS\\sauvegardes\Save_Profils\%username%\%Poste%\\IECfg.reg "HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer"
REGEDIT /S /e \\SERVEUR\transferts\GEEKERS\\sauvegardes\Save_Profils\%username%\%Poste%\\LctRsx.reg "HKEY_CURRENT_USER\Network"
REGEDIT /S /e \\SERVEUR\transferts\GEEKERS\\sauvegardes\Save_Profils\%username%\%Poste%\\ImprRsx.reg "HKEY_CURRENT_USER\Printers"
REGEDIT /S /e \\SERVEUR\transferts\GEEKERS\\sauvegardes\Save_Profils\%username%\%Poste%\\ImprDft.reg "HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Windows"


pause
goto home


:RESTORE
rem set /p Poste= indiquer le nom du PC:
xcopy "\\SERVEUR\transferts\GEEKERS\sauvegardes\Save_Profils\%username%\signatures" "%appdata%\microsoft\signatures\" /s /e /y /i
xcopy "\\SERVEUR\transferts\GEEKERS\sauvegardes\Save_Profils\%username%" "%userprofile%\" /s /e /y /i
xcopy "\\SERVEUR\transferts\GEEKERS\sauvegardes\Save_Profils\%username%\TaskBar" "%AppData%\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar" /s /e /y /i
xcopy "\\SERVEUR\transferts\GEEKERS\sauvegardes\Save_Profils\%username%\outlook" "%userprofile%\AppData\Roaming\Microsoft\Outlook"/s /e /y /i
xcopy "\\SERVEUR\transferts\GEEKERS\sauvegardes\Save_Profils\%username%\Favorites\" "%userprofile%\Favorites\" /S/Y
xcopy "\\SERVEUR\transferts\GEEKERS\sauvegardes\Save_Profils\%username%\downloads\" "%userprofile%\downloads\"*.* /S/Y
xcopy "\\SERVEUR\transferts\GEEKERS\sauvegardes\Save_Profils\%username%\pictures\" "%userprofile%\pictures\"*.* /S/Y
xcopy "\\SERVEUR\transferts\GEEKERS\sauvegardes\Save_Profils\%username%\videos\" "%userprofile%\videos\"*.* /S/Y
xcopy "\\SERVEUR\transferts\GEEKERS\sauvegardes\Save_Profils\%username%\music\" "%userprofile%\music\"*.* /S/Y
xcopy "\\SERVEUR\transferts\GEEKERS\sauvegardes\Save_Profils\%username%\"virtual machines"\" "%userprofile%\virtual machines"\"*.* /S/Y
xcopy "\\SERVEUR\transferts\GEEKERS\sauvegardes\Save_Profils\%username%\links\" "%userprofile%\links\"*.* /S/Y
xcopy "\\SERVEUR\transferts\GEEKERS\sauvegardes\Save_Profils\%username%\"saved games"\" "%userprofile%\"saved games"\*.* /S/Y
xcopy "\\SERVEUR\transferts\GEEKERS\sauvegardes\Save_Profils\%username%\contacts\" "%userprofile%\contacts\"*.* /S/Y
xcopy "\\SERVEUR\transferts\GEEKERS\sauvegardes\Save_Profils\%username%\desktop\" "%userprofile%\Desktop\"*.* /S/Y
xcopy "\\SERVEUR\transferts\GEEKERS\sauvegardes\Save_Profils\%username%\"My Documents"\" "%userprofile%\Documents\"*.* /S/Y
xcopy "\\SERVEUR\transferts\GEEKERS\sauvegardes\Save_Profils\%username%\"Outlook PST"\" "%localappdata%\Microsoft\Outlook\"*.pst /S/Y
xcopy "\\SERVEUR\transferts\GEEKERS\sauvegardes\Save_Profils\%username%\"Outlook Signature"\" "%appdata%"\Microsoft\Signatures\*.* /S/Y
xcopy "\\SERVEUR\transferts\GEEKERS\sauvegardes\Save_Profils\%username%\outlook_name\" "%appdata%"\Microsoft\Outlook\*.* /S/Y


REGEDIT /S \\SERVEUR\transferts\GEEKERS\sauvegardes\Save_Profils\%username%\%Poste%\\OutCfg.reg "HKEY_CURRENT_USER\Software\Microsoft\Office\11.0\Outlook"
REGEDIT /S \\SERVEUR\transferts\GEEKERS\sauvegardes\Save_Profils\%username%\%Poste%\\IECfg.reg "HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer"
REGEDIT /S \\SERVEUR\transferts\GEEKERS\sauvegardes\Save_Profils\%username%\%Poste%\\LctRsx.reg "HKEY_CURRENT_USER\Network"
REGEDIT /S \\SERVEUR\transferts\GEEKERS\sauvegardes\Save_Profils\%username%\%Poste%\\ImprRsx.reg "HKEY_CURRENT_USER\Printers"
REGEDIT /S \\SERVEUR\transferts\GEEKERS\sauvegardes\Save_Profils\%username%\%Poste%\\ImprDft.reg "HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Windows"


pause


echo FINI
pause
goto home

Partager cet article

Repost 0
Publié par Vaks - dans DOS SCRIPTS TUTOS
commenter cet article