I want to copy files that have date modified attribute values within a specific date range from one folder to another. I'm able to perform the copy using the below script but it's only copying the root level files within the parent directory of the source location
I need to copy the entire folder structure for files meeting the date range requirement.
SET DESTINATION=c:\temp\new SET DATE_FROM=01/01/2019 SET DATE_TO=01/10/2019 > nul forfiles /S /D +%DATE_FROM% /C "cmd /C if @isdir==FALSE 2> nul forfiles /M @file /D -%DATE_TO% && > con ( echo @path && copy /V @path %DESTINATION% )" pause
This batch script copies all the files within the specified date range to the root of the
C:\temp\new folder but it doesn't copy the source folder structure with it. I need the destination to also contain the matching source folder structure for copied files within the defined date range.