Running Microsoft SyncToy 2.0 in a script

By bds_1959 ·
I am trying to come up with a script to run Microsoft SyncToy 2.0 that I can use at both logon and logoff. The backup is for a couple of Senior Managers who have laptops; backing data up to an external [USB] drive. I have spent hours doing various tests with bits and pieces of scripts I've found browsing the Internet, but I just can't seem to find the right combination to make things do what I want. Unfortunately I have virtually no experience in scripting, so that's obviously not helping me. Ultimately I'd like to have a script that verifies the "left" and "right" drives for the backup, (the "left," or "from," is actually a TrueCrypt file on the hard drive; if the file isn't mounted, obviously the backup wouldn't work, and I'd like to have a message to that affect,) but to start, I'd settle for just a simple script that works and the extra logic can be added later! One of the things that I'm running into is that it doesn't appear that the "-R" switch is working on the SyncToyCmd.exe - this seems like something that shouldn't be so difficult! Any help would be greatly appreciated! Thanks!

This conversation is currently closed to new comments.

Thread display: Collapse - | Expand +

All Answers

Collapse -

here's something that might help...

by ---TK--- In reply to Running Microsoft SyncToy ...

This is what I use for backups....

@echo off
title Backup PC for XP
color 0E

echo ***Please wait while backup completes***
echo ***This may take a few minutes**********
echo ***Start Time is %time%

Rem ***********Kills Outlook******************************
taskkill /T /IM outlook.exe 2>Nul | FIND "SUCCESS:" >NUL
PING -n 6 2>Nul | FIND "TTL=" >NUL
taskkill /F /T /IM outlook.exe 2>Nul | FIND "SUCCESS:" >NUL
PING -n 3 2>Nul | FIND "TTL=" >NUL

Rem ************Deletes Old Backup Folder*****************
rd /s /q "D:\backup\%username%\Backup" 2>nul

Rem *************Gets Date and sets Var********************
for /F "tokens=2-4 delims=/- " %%A in ('date/T') do set var=%%C-%%B-%%A
md "D:\backup\%username%\Backup\%var%\Outlook" 2>nul
md "D:\backup\%username%\Backup\%var%\My Documents" 2>nul
md "D:\backup\%username%\Backup\%var%\Favorites" 2>nul
md "D:\backup\%username%\Backup\%var%\Desktop" 2>nul


xcopy /E /F /H "%userprofile%\Local Settings\Application Data\Microsoft\Outlook" "D:\backup\%username%\Backup\%var%\Outlook"
xcopy /E /F /H "%userprofile%\Desktop" "D:\backup\%username%\Backup\%var%\Desktop"
xcopy /E /F /H "%userprofile%\Favorites" "D:\backup\%username%\Backup\%var%\Favorites"
xcopy /E /F /H "%userprofile%\My Documents" "D:\backup\%username%\Backup\%var%\My Documents"

Related Discussions

Related Forums