You want something like this:
https://www.mobileread.com/forums/sho...d.php?t=244228
Unfortunately, it is for linux not Windows. But it provides the concept behind what needs doing, and a basic structure.
It shouldn't be hard to convert it from linux bash syntax to Windows batch file syntax, and rsync has been built for windows. (maybe install cygwin?)
Alternatively, there are several windows programs for syncing, such as
FreeFileSync. It should even be possible to script them.
NOTE: Make sure to use the mirror sync mode.