Sync Two Folders in Real Time on Windows
In this article
Keeping two folders identical as you work—say, a project folder and a backup drive, or a local folder and a network share—saves you from manual copying and version confusion. This guide shows you how to set up real-time folder syncing on Windows using built-in tools and free utilities, so changes appear in both places almost instantly.
What You'll Need
- Windows 10 or Windows 11 (the steps work on both)
- Two folders you want to keep in sync (they can be on the same drive, different drives, or a network location)
- Administrator rights on your PC (needed to create scheduled tasks)
- Optional: a free third-party sync tool like FreeFileSync or SyncToy if you want a graphical interface
Step-by-Step
There are two main approaches: using a built-in Windows method (Robocopy with Task Scheduler) or using a free third-party tool. Both achieve real-time syncing—the first is more technical, the second is easier for most people.
Option 1: Using Robocopy and Task Scheduler (Built-in)
- Open Task Scheduler. Press Win, type “Task Scheduler,” and press Enter.
- Create a new task. In the right-hand panel, click “Create Task…” (not “Create Basic Task”).
- Name your task. Give it a descriptive name like “Sync Folder A to B.”
- Set the trigger. Go to the “Triggers” tab, click “New…”, set “Begin the task” to “On an event,” choose “Log: Microsoft-Windows-Kernel-File/Disk,” “Source: Kernel-General,” and “Event ID: 12” (this fires when a file is created or modified). Click OK.
- Set the action. Go to the “Actions” tab, click “New…”, set “Action” to “Start a program,” and in “Program/script” enter
robocopy. In “Add arguments” enter:"C:\SourceFolder" "D:\DestinationFolder" /MIR /R:1 /W:1(replace the paths with your own). Click OK. - Adjust settings. In the “Settings” tab, check “Run task as soon as possible after a scheduled start is missed” and “Stop the task if it runs longer than” (set to, say, 1 hour). Uncheck “Stop the task if it runs longer than” if you want it to run indefinitely.
- Enable the task. Make sure “Enabled” is checked in the “General” tab. Click OK and enter your password if prompted.
- Test it. Create a test file in the source folder. Within a few seconds, it should appear in the destination folder. If not, check the Task Scheduler “History” tab for errors.
Option 2: Using a Free Third-Party Tool (Easier)
- Download and install FreeFileSync (or a similar tool). Go to the official FreeFileSync website and download the Windows version. Run the installer.
- Open FreeFileSync. You’ll see two panels: left is the source, right is the destination.
- Select your folders. Click the “Browse” button on each side and choose the two folders you want to sync.
- Set the sync direction. Click the green gear icon (or “Mirror” in the toolbar) and choose “Mirror” to make the right folder an exact copy of the left, or “Two way” to sync changes in both directions.
- Run a test sync. Click “Compare” to see what would change, then click “Synchronize” to actually copy files. This confirms the setup works.
- Enable real-time monitoring. In FreeFileSync, go to “Tools” → “Options” and check “Auto-close” and “Run minimized.” Then, to watch folders continuously, use the “RealTimeSync” companion app that comes with FreeFileSync. Open it, add your source folder, set a delay (e.g., 10 seconds), and point it to the FreeFileSync batch job you saved earlier.
- Save the batch job. In FreeFileSync, go to “File” → “Save as batch job.” Choose “Mirror” or “Two way” as the default, and check “Run minimized” and “Auto-close.” Save it as a .ffs_batch file.
- Schedule RealTimeSync. Open RealTimeSync, add the source folder, set the idle time (e.g., 10 seconds), and browse to your .ffs_batch file. Then start it. It will run in the system tray and sync automatically whenever files change.
Common Mistakes
- Wrong Robocopy flags. Using
/MIRwill delete files in the destination that don’t exist in the source. If you want two-way sync, you need a different tool or a more complex script. - Not testing the trigger. The Task Scheduler event may not fire if the event log is full or if the source is on a network drive. Always test with a real file.
- Running the sync manually after the first time. If you run Robocopy manually, it will sync once, but the scheduled trigger won’t know about it—make sure the task is enabled.
- Forgetting to save the batch file in FreeFileSync. RealTimeSync needs the .ffs_batch file to know what to do. If you don’t save it, it won’t work.
- Syncing the wrong direction. In Mirror mode, the right folder becomes an exact copy of the left. If you set it backwards, you could overwrite newer files with older ones.
Tips
- Use a small delay in RealTimeSync. A 10–30 second delay prevents syncing while you’re still saving a large file.
- Test with unimportant files first. Before syncing critical data, create a test folder with a few dummy files to confirm the behavior.
- For network drives, use UNC paths. Instead of mapped drive letters (like Z:), use \\server\share\folder—this is more reliable with Task Scheduler.
- Keep a backup. Real-time sync is not a backup—if you accidentally delete a file in the source, it will be deleted in the destination too. Use a versioning tool or a separate backup for that.
- Run as administrator. If you get permission errors, make sure the task runs with highest privileges, or run FreeFileSync as admin.
Troubleshooting
- Files don’t sync at all. Check that the task is enabled in Task Scheduler, and that the trigger is set to “On an event” with the correct log and event ID. In FreeFileSync, check the system tray icon for errors.
- Files sync only once. The trigger might not be firing. Try changing the trigger to “On a schedule” (e.g., every 5 minutes) as a fallback, or use RealTimeSync instead.
- Permission errors. Right-click the task in Task Scheduler and choose “Run” to see the error. Make sure the folder paths are accessible and you have write permissions.
- Robocopy returns error codes. In Task Scheduler, the action’s “Add arguments” may have wrong quotes. Ensure the paths are enclosed in double quotes and there’s a space before /MIR.
- RealTimeSync doesn’t start. Make sure you’ve saved the batch job in FreeFileSync first. Also, check that the .ffs_batch file path in RealTimeSync is correct.
- Sync is too slow. Large files may take time. Increase the delay in RealTimeSync to avoid overlapping syncs.
Frequently Asked Questions
Can I sync two folders on different drives?
Yes, both Robocopy and FreeFileSync work across drives, whether local or network. Just make sure the destination drive has enough space.
Is real-time sync the same as backup?
No. Real-time sync mirrors changes, including deletions. A backup keeps historical versions. Use both for full protection.
Will this work with OneDrive or Google Drive folders?
Yes, but be careful: syncing a cloud folder to another location may cause conflicts if the cloud client is also syncing. It’s better to sync from the cloud folder to a local backup, not the other way around.
Can I pause the sync?
Yes. In Task Scheduler, you can disable the task. In RealTimeSync, you can right-click the tray icon and exit, or pause by stopping the process.
What happens if I edit a file while it’s being synced?
Most tools wait for the file to be closed or for a quiet period. Robocopy may copy a partial file if you don’t use /R:1 /W:1 (retry once, wait 1 second). FreeFileSync’s RealTimeSync waits for the idle time you set.
Is there a way to sync without installing anything?
Yes, the Robocopy + Task Scheduler method uses only built-in Windows tools. It’s more technical but works on any Windows 10/11 machine.