Batch Script – Backup folder over network

Here is a batch script I use to make a backup of my laptop. I have it backing up multiple folders, but here is example of backing up a laptop folder (My Thunderbird Profile) to a networked computer share. Will work both ways.

for /f “tokens=2-4 delims=/ ” %%g in (‘date /t’) do (
set mm=%%g
set dd=%%h
set yy=%%i
)

if exist “\IPADDESSc$UsersAdministratorDocumentsMy Laptop Backups%mm%-%dd%-%yy%” (
rd /S /Q “\IPADDRESSc$UsersAdministratorDocumentsMy Laptop Backups%mm%-%dd%-%yy%”
)

xcopy “C:UsersAdministratorAppDataRoamingThunderbirdProfiles”
“\IPADDRESSc$UsersAdministratorDocumentsMy Laptop Backups%mm%-%dd%-%yy%” /s /i