Tutos, Infos et Astuces.

BATCH: Sauvegarde profil windows

@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

Retour à l'accueil
Partager cet article
Repost0
Pour être informé des derniers articles, inscrivez vous :
Commenter cet article