Hello, I am using robocopy to copy files from source to destination folder but there are some problems.

In the source folder .csv files are created by various users every 15-20 mins for example User1.csv, User2.csv, User3.csv. There is an archive folder on the source folder.

These files have to be moved to a destination folder. The files on the destination folder are uploaded to a different application every 30 mins.

Problem: When user1 creates a file user1.csv, it has to be moved to the destination folder. If a file already exists on the destination folder then it should not be moved. But if no file exists on the destination folder then the file needs to be moved and a copy of the file has to be saved on archive folder.

@echo off

SET SORC= “C:\Test\Source”
SET DEST=“C:\Test\Destination”
SET LOG=“C:\Test\THE LOG FILE.log”

ROBOCOPY %SORC% %DEST% *.csv /R:1 /W:1 /MOV /XN /XO /LOG:%LOG%

:END

I am using the above code to move the files.

How can i save the files on the archive folder with the same name every time a new file is created?

4 Spice ups

Use ROBOCOPY /? to get the parameters to do what you’re after.

single source multiple destination

1 Spice up