Windows batch script to move files

user2273893 picture user2273893 · Apr 12, 2013 · Viewed 121.7k times · Source

I need to move files from one directory to another in windows, and I need to write this in a batch script.

We have written a SQL job where backup files will be created every 4 hours on the D: drive and last 4 backup files will be saved and others will be deleted.

I need to write a batch script to move these files from the D: drive to the E: drive every 10 hours.

Can anyone help me to write this script.

Answer

SwampYeti picture SwampYeti · Apr 12, 2013

Create a file called MoveFiles.bat with the syntax

move c:\Sourcefoldernam\*.* e:\destinationFolder

then schedule a task to run that MoveFiles.bat every 10 hours.