I just want to copy files from the past 1 or 2 days or the latest files (and the number of files in the two directories is inconsistent), and not copy others.
I want to copy 2 files in the current folder that meet the conditions and copy them to another place.
The current folder is db, the location where daily backups are stored. I want to copy the latest backup of each day to another place
for /f "tokens=FY_*.bak" %%i in ('dir F:\DB_BAK /o:-d-s /b') do (set file=%%~fi)&(goto :next1)
:next1
copy %file% C:\ /y
I wonder what good ideas all the experts have?
I want to copy 2 files in the current folder that meet the conditions and copy them to another place.
The current folder is db, the location where daily backups are stored. I want to copy the latest backup of each day to another place
for /f "tokens=FY_*.bak" %%i in ('dir F:\DB_BAK /o:-d-s /b') do (set file=%%~fi)&(goto :next1)
:next1
copy %file% C:\ /y
I wonder what good ideas all the experts have?
