Local User Folders - Backup and Restore

Local User Folders - Backup and Restore 

Create a directory on the users home folder:  "BackupProfiles"

UserBackup.bat

@echo off
for %%p in (a b c d e f g h i j k l m n o p q r s t u v w x y z) do if exist %%p:\BackupProfiles\ set drive=%%p
echo Let's start the backup process:
pause
title Backup my files and folders
mkdir %drive%:\BackupProfiles\%username%
robocopy "%userprofile%" "%drive%:\BackupProfiles\%username%" /MIR /XD "%userprofile%\Application Data" "%userprofile%\AppData" "%userprofile%\Local Settings" "%userprofile%\OneDrive" "%userprofile%\Cookies" "%userprofile%\Cisco Packet Tracer 6.2sv" /XF *.dat *.regtrans-ms *.blf ntuser.ini *.LOG1 *.LOG2
echo Copy Complete
goto exit
:exit
pause

 

UserRestore.bat

@echo off
for %%p in (a b c d e f g h i j k l m n o p q r s t u v w x y z) do if exist %%p:\BackupProfiles\ set drive=%%p
echo Let's start the restore process:
pause
title Restore my files and folders
REM mkdir %drive%:\BackupProfiles\%username%
robocopy "%drive%:\BackupProfiles\%username%" "%userprofile%" /MIR
echo Restore Complete
goto exit
:exit
pause