Check for a folders last modified date

January 23, 2010 at 17:58:55
Specs: windows 2003
Hi.. i want a batch file which checks for folders last modified date and if it matches todays date and a specific time, then rename and copy the folder to another specific location.

See More: Check for a folders last modified date

Report •


#1
January 23, 2010 at 22:07:21
This is wired to process today's XLS files. You can alter the file type in the 3rd FOR loop and test it. If that seems OK we can hammer out the time part.

=============================
@echo off > %TEMP%\#-# & setLocal EnableDelayedExpansion

for /f "tokens=* delims= " %%a in ('dir/b/s %TEMP%\#-#') do (
set mydate=%%~Ta
)

for /f "tokens=1 delims= " %%a in ("!mydate!") do (
set today=%%a
)

for /f "tokens=* delims= " %%a in ('dir/b/a-d *.xls') do (
set TD=%%~Ta
for /f "tokens=1 delims= " %%a in ("!TD!") do (
set filedate=%%a
)
if !filedate! equ !today! echo process %%a
)


=====================================
Helping others achieve escape felicity

M2


Report •
Related Solutions


Ask Question