I need to create a scheduled task that copies files from a folder A to a Folder B (map drive). In the destination directory I need to retain copied files for only one month (after which it will overwrite the older files). I also want to purge older files in the source directory.

I tried using the following:

xcopy /s c:\Folder1 d:\Folder2

but I'm not sure about the one month retention as I have never played with this before.I know a bit about how to copy the files, but not sure about implementing the one month retention aspect. I have tried using Robocopy for this task as well.

How can I achieve this ?

  • 1
    Please give a clearer description of what you're trying to do. Explain also what you have tried that didn't work.
    – harrymc
    Jul 5 at 15:05
  • i try xcopy /s c:\Folder1 d:\Folder2 but im not sure about the one month retention i never play with this before Jul 5 at 15:30
  • For this kind of operations, a more suitable utility is robocopy.
    – harrymc
    Jul 5 at 15:31
  • ok can you help me with this since im not familiar with this Jul 5 at 15:45
  • 1
    well maybe not overwrite but copy new file and like you said maybe a separate job that delete old files Jul 5 at 16:37


You must log in to answer this question.

Browse other questions tagged .