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.
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 EnableDelayedExpansionfor /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 felicityM2
Yes (14) | ![]() | |
No (14) | ![]() | |
I don't know (15) | ![]() |