Batch sript to copy the folders modified toda

June 11, 2009 at 06:45:48
Specs: Windows XP

I need a batch script to copy the today modified sub-folders of a folder to a new folder.


Folder "f:/test1" is having total 5 sub-folders and I want to copy only today created/modified sub-folders from "f:/test1" to "f:/test2" folder.

I have the following script whis is only copying the today modified files but not the folders.

Please help to resolve this issue.

::Copy Files Made Or Modified Today
@echo off
set source=f:\test12
set dest=f:\test23
pushd "%source%"
set t=%date:~4%
for /f %%a in ('dir /b /a-d /o-d') do call :PROCESS "%%a"
goto :eof

echo %date:~4%
for /f %%j in ('echo %~t1') do set d=%%j
if "%d%"=="%t%" copy "%1" "%dest%"
goto :eof


See More: Batch sript to copy the folders modified toda

Report •

June 11, 2009 at 18:09:09
because you are using the switch /a-d . check dir /? to use correct switch for folders

Report •
Related Solutions

Ask Question