How to copy only new files AND only those that are modified after a certain date?



IT administrators often have the need to copy files that have been modified after a certain date. This could be due to a variety of reasons - such as to back up a system, or to move files to a new system. In this article, we will discuss how to copy only new files and only those that are modified after a certain date.

The first step to copying only new files and those modified after a certain date is to use the Windows Command Prompt. To open the Command Prompt, go to the Start Menu, type “cmd”, and press Enter. Once the Command Prompt is open, you can use the “xcopy” command.

The xcopy command has several switches that determine how it will function. To copy only new files and those modified after a certain date, the switches you need to use are “/d:m-d-y” and “/e”. The “/d:m-d-y” switch sets the date that files must have been modified after in order to be copied. The “/e” switch specifies that all subdirectories should be copied, even if they are empty.

For example, if you wanted to copy only files modified after April 1, 2019, you would use the command “xcopy /d:4-1-2019 /e”. This command would copy all files modified after April 1, 2019, as well as all subdirectories, even if they are empty.

It is also possible to use the xcopy command to copy only files that are newer than those already existing in the destination directory. To do this, use the “/u” switch. This switch will copy only files that are newer than those that already exist in the destination directory.

For example, if you wanted to copy only files modified after April 1, 2019, that are newer than the existing files in the destination directory, you would use the command “xcopy /d:4-1-2019 /e /u”. This command would copy only files modified after April 1, 2019, that are newer than the files already existing in the destination directory, as well as all subdirectories, even if they are empty.

In addition to the xcopy command, it is also possible to use the “robocopy” command to copy only new files and those modified after a certain date. The robocopy command has several switches that determine how it will function. To copy only new files and those modified after a certain date, the switches you need to use are “/minlad:m-d-y” and “/e”. The “/minlad:m-d-y” switch sets the date that files must have been modified after in order to be copied. The “/e” switch specifies that all subdirectories should be copied, even if they are empty.

For example, if you wanted to copy only files modified after April 1, 2019, you would use the command “robocopy /minlad:4-1-2019 /e”. This command would copy all files modified after April 1, 2019, as well as all subdirectories, even if they are empty.

In summary, IT administrators can use the Windows Command Prompt to copy only new files and those modified after a certain date. To do this, use either the “xcopy” command or the “robocopy” command. The “/d:m-d-y” switch should be used with the xcopy command, and the “/minlad:m-d-y” should be used with the robocopy command. Additionally, the “/u” switch can be used with the xcopy command to copy only files that are newer than those already existing in the destination directory. Using these commands, IT administrators can easily copy only new files, and those modified after a certain date.

Inquire Now

Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.
Find your next full or part-time role here

ScaleDesk can either help you find your next full time gig or a part time side gig where you can create extra income!

Onboard with us once
Skip HR screening and go to the final interview with with only your resume and a video interview you never have to redo
Get paid electronically every month for the hours you work
We will be your reference even if you work for us once

IT Teams: Use ScaleDesk to augment your team

Schedule Demo