@echo off
setlocal enabledelayedexpansion
set ChkYYYY=2014
set TgtDir=d:\target
for /r %%A in (*.*) do (
set FD=%%~tA
set YYYY=!FD:~6,4!
if "!YYYY!" equ "%ChkYYYY%" (
set SPath=%%~pA
ECHO xcopy /i "%%~fA" "%TgtDir%!SPath!"
)
)
robocopy.exe "D:\Source\Folder" "E:\Target\Folder" *.* /s /r:0 /w:0 /np /tee /log:"C:\Temp\robocopy.log" /maxage:20140101 /minage:20141231 /TS /L
/s will process subfolders, /r:0 and /w:0 set the the retry count and wait time in seconds (usually only needed over unreliable networks), /np will disable the progress bar for larger files (because it uses control characters that make the log file hard to read), /tee sends the output to the console and a log file, and /log sets the log file.forfiles /s /d -3/1/2015 /P "C:\Users\pcadmin\Downloads" /c "cmd /c echo @path"
forfiles /s /d -3/1/2015 /c "cmd /c copy @path c:\move"
set SrcDir=c:\users\me\documents
set TgtDir=c:\test\documents
robocopy.exe "%SrcDir%" "%TgtDir%" /s /r:0 /w:0 /np /tee /log:"%temp%\robocopy.log" /maxage:20140101 /minage:20141231 /TS
Do you really mean the Created date? Or do you mean the Modified date? The /d parameter in the forfiles command posted above is for the Modified date, not the Created date. Here's a description of the forfiles command:
http://ss64.com/nt/forfiles.html
Regards, Joe