1

For a solution, I'm looking for a basic tool that can copy files from location A to B. There is one major rule for this:

Only files in location A that where not there the last time the tool ran, need to be copied to location B.

I've looked into Robocopy. I saw the option to copy files from A to B. However, in location B, the files are deleted after they have been used. So robocopy keeps copiying them every time. I only need to have new files in location B.

Hope this is clear and there is a solution for my challenge.

Sunfile
  • 111
  • 3

2 Answers2

1

Files on Windows have an 'Archive' attribute which is set on creation and every time the file is modified.

You can use Robocopy with the /m option to only copy those files which have +A set and automatically unset it after copying. The next time you run robocopy /m it will skip the already-copied files.

(Note that +A is also set when the file is moved or renamed – but not when the parent directory is moved or renamed.)

grawity
  • 501,077
1

You need to use switchs :

/maxlad:Specifies the maximum last access date (excludes files unused since N).

/minlad:Specifies the minimum last access date (excludes files used since N) If N is less than 1900, N specifies the number of days. Otherwise, N specifies a date in the format YYYYMMDD. the info in this link may help: Robocopy command to copy updated files and long path names