Posted on Leave a comment

Move files to replicated datastore using bat script

You can use a very simple bat script in order to automatically move files from a specific windows disk to another one.

An example for this particular scenario is a case that you want to copy files from a disk to another one that resides in a datastore that is replicated. You can automatically move those files from the first disk to the second one in order to get them replicated.

All you have to do, is to create an automatic task with windows task scheduler that its action will be to run the following bat script.

xcopy /s/e/y C:\Users\USER1\Desktop\folder1 D:\Users\folder2
echo %time% %date% >> D:\Users\folder2\log.txt