Robocopy script that monitors and sync new and modified files?

peter7277

New member
Member
Local time
6:02 AM
Messages
83
I need a robocopy script that will run on startup and monitor for modified and new files in specified directories and sync these files instantly when they are detected. How the script will look like? I hope some more advanced user can help me with the code.
 

My Computer My Computer

Computer type
PC/Desktop
OS
Windows 7 Ultimate x64
Simple robocopy c:\data d:\data /mir that mirrors data to other drive
 

My Computer My Computer

Computer type
PC/Desktop
OS
win 8 32 bit
I made this script:

Code:
@echo off

robocopy c:\data d:\data /mir
and when i run the script it copy the directory and then exits, and i want the script to run constantly and monitor for changes. Is that possible?

edit: I found how to make the script to run constantly - by using the /mon:1 parameter. But now the problem is that command prompt window stays open. Is there way to make the script to run without opening the command prompt window?
 
Last edited:

My Computer My Computer

Computer type
PC/Desktop
OS
Windows 7 Ultimate x64

My Computer My Computer

Computer type
PC/Desktop
Computer Manufacturer/Model Number
diy
OS
Win7 pro x64
CPU
stock i7 7700k
Motherboard
Gigabyte Z270N-WIFI mini-ITX
Memory
Corsair Vengeance LPX 16GB (2x8GB) DDR4 @ 3200MHz
Graphics Card(s)
integrated Intel HD 630
Sound Card
onboard Realtek ALC1220
Monitor(s) Displays
two vertically mounted samsung 55" 4k un55mu8000
Screen Resolution
1920x1280
Hard Drives
256GB Samsung EVO 960 M.2 pci-e NVMe SSD
PSU
SilverStone Nightjar ST45NF 450Watt Fanless
Case
No case. Motherboard is mounted directly onto power supply
Cooling
Evercool low profile 815EP with Panaflow 12L fan at 7v
Keyboard
Ortek MCK-86 mini
Mouse
Belkin 5-button USB
Internet Speed
spectrum 400mbps
Thanks, for the script. I also found that i can start .cmd script hidden with autohotkey script.

But i have another issue. I am trying to monitor the files in two directories and i have these lines:

Code:
robocopy e:\dir1 e:\dir1 /mir /mon:1
robocopy e:\dir2 e:\dir2 /mir /mon:1
but when i start the script it monitors only the first directory and not second. Why is that?
 

My Computer My Computer

Computer type
PC/Desktop
OS
Windows 7 Ultimate x64
Back
Top