You are currently browsing the archives for the SyncToy category.

Setting Up The SyncToy Automation Script

Setting Up The SyncToy Automation Script

The VB Script that I’m going to show you will check the current time of day, and will run the appropriate command to launch the Microsoft SyncToy program and back up the right directory.

It does this by using the name of the paired directory that you set up in the tool above. Copy the script into notepad and save it as something like “databackup.wsf”.

<script language="VBScript">
Option Explicit
On Error Resume Next
Dim HourNow
Dim strHour
Dim WshShell
Dim strProgFiles
HourNow = Hour(Now())
set WshShell=CreateObject("WScript.Shell")
strProgFiles = WshShell.ExpandEnvironmentStrings("%PROGRAMFILES%")
Select Case HourNow
 case HourNow >= 0 and HourNow < 7
 WshShell.exec strProgFiles & "SyncToy 2.1SyncToyCmd.exe -R MorningFiles"
 case HourNow >= 7 and HourNow < 13
 WshShell.exec strProgFiles & "SyncToy 2.1SyncToyCmd.exe -R NoonFiles"
 case HourNow >= 13 and HourNow < 19
 WshShell.exec strProgFiles & "SyncToy 2.1SyncToyCmd.exe -R MailArchives"
 case else
 WshShell.exec strProgFiles & "SyncToy 2.1SyncToyCmd.exe -R EveningFiles"
End Select

The script above simply checks the hour right now (based on the PC clock where the script runs), and if it is between midnight and 6:59 a.m., it will sync the “MorningFiles” pair that you set up. Between 7 a.m. and 12:59, the “NoonFiles” pair, and so on.

All you have to do now is set up a Windows scheduled task that will launch the script above four times a day within the four time spans. This is also pretty easy, just go to the Control Panel, Administrative Tools, and open up the Task Scheduler. Click on “Create Task”.

data backup system

Name the task, and then click on the trigger tab. Make sure to select “On a schedule“, Daily, recur every day, start at 3 a.m., and then at the bottom click to repeat the task every 6 hours. This will trigger the task at 0300, 0900, 1500 and 2100 hours.

backup data

Those are all within one of the four time spans that you scheduled into your script. Now click on the Actions tab, and select “Start a program” from the dropdown list and browse to where you stored the script.

backup data

That’s all there is to it! Now, the task scheduler will launch your single script four times a day (no need to mess with multiple tasks). Your script will handle launching SyncToy in command mode by launching “SyncToyCmd.exe -R EveningFiles” – with whatever file pair you named after “-R”.

You can monitor whether your script is running by checking the SyncToy log file at “C:UsersOwnerAppDataLocalMicrosoftSyncToy2.0SyncToyLog.log

data backup

The log updates every time SyncToy is run, and it’ll show you what directory was backed up, when it was done, the file count and the size of the backup.

Does this data backup solution work for you? Do you have any other ways you like to automatically back up important data files and folders? Share your thoughts in the comments section below.

Categories: SyncToyBookmark

How to Automated SyncToy backups batch mode

How to Automated SyncToy backups batch mode

As this backup job is going to be run by the user, we want to make the process as simple as possible. SyncToy has nice feature that allows it to run in batch mode by using -R switch. Open notepad and add the follow line “C:Documents and Settings<your username>Local SettingsApplication DataSyncToySyncToy.exe” -R.

notepad synctoy batch file

You might need to double check the location of the SyncToy.exe as this varies depending on the version of Windows. Save the file with a .bat extension to the desktop. Now the user can simply double click on the batch file and SyncToy will complete backup jobs that have been defined.


Alternatively you can have Windows Task Schedule (Found in the control panel) run the batch so the whole process becomes automated.

Categories: SyncToyBookmark

Schedule SyncToy to Run Automatically With Task Scheduler in Windows 7

Schedule SyncToy to Run Automatically With Task Scheduler in Windows 7

SyncToy is a great tool to help you keep your files and folders synced between drives and devices.  Here’s how you can make it do sync automatically so your files will stay synced even if you forget to sync them.

By default, SyncToy only synchronizes your files when your fun the program and directly tell it to sync.  This might work fine for syncing files to a flash drive before heading out on a trip, but makes it difficult if you’re using it to synchronize files regularly between folders or drives on your computer or with Dropbox.  Windows includes an often overlooked scheduling tool that can automatically run many applications without any action on your part.  Let’s see how you can setup SyncToy to automatically sync with the Task Scheduler.

Automatically Run SyncToy

First, make sure you have SyncToy installed and have some syncs setup.


Now open Task Scheduler to get SyncToy automatically syncing.  Type Task Scheduler in the Search box in the Start Menu and hit Enter.

Once Task Scheduler opens, click Create Basic Task on the right sidebar.

Enter a name and a description for your task in the dialog that opens so you’ll be able to easily recognize your task.

Choose how often you want to run the task.  Note that Daily is the most frequent you can select in the dialog, but we can tweak this later in the settings.  Click Next to continue.

You’ll be asked to add additional settings depending on the trigger you selected previously.  If you chose Daily, then the default settings should work fine.  Note that it will automatically run daily at the current time; if you’d rather it run at a different time, enter the time you’d like in the box.

Now, you’ll be asked what you want the action to do…Click Start a program.

In the Program/script box, enter the following including the quotes:

“C:Program FilesSyncToy 2.1SyncToyCmd.exe”

Then, in the Add arguments box, enter –R to run all of your syncs each time.

Alternately, if you’d only like to run one of your syncs, enter –R “your sync name”.  Make sure to enter the sync name inside quotes if it contains any spaces.  Once you’re finished, click Next to continue.

If you left out the quotes in the program’s field, Task Scheduler will ask if you want to run C:Program with the remainder as an argument.  Click No to keep it like you entered, and Task Scheduler will add the quotes correctly for you.

You’re finally finished.  The Wizard will show you a summary of the sync settings; click Finish to save the changes.

Now your sync will automatically run as you set, and you’ll never have to worry about running it manually again!

Edit Your Sync Schedule

If you’d like to make your files sync more often or change other things about your task, you can easily do so from the Task Schedule interface.  Click on the Task Scheduler Library on the left side to find your task.

Scroll through the tasks listed, and find the one you created previously.  You’ll see an overview of its settings in the preview underneath.

On the right sidebar, click Properties to change its settings.

To change how frequently it syncs, click the Triggers tab and double-click on your time listed.

Now you can select to have it repeat the task every hour or any other time you want, for as long as you want.  This dialog is much more flexible than the previous one used when creating the task.

Back in the Properties dialog, the Conditions tab lets you choose whether or not to run this task when your computer is running on battery power if you’re using a laptop/netbook.  By default it will only run when on AC power, but you can uncheck the box if you’d rather it sync even if you’re on battery.

You can also go ahead and run the task manually from the Task Scheduler if you’d like.  You may notice a command prompt window open while the sync is running, but it won’t require any input from you.


No matter what you need to sync, SyncToy is a handy tool to make sure all of your files are kept in different locations.  You can run as many syncs as you want automatically with the Task Scheduler, freeing you up for more important tasks.

Categories: SyncToyBookmark