Set date/time of log file as variable

September 30, 2009 at 13:42:49
Specs: Windows XP
I am trying to get either the modified date from a log file (hacstime.log) or the date/time contained in the log file and set it as a variable (Htime) in the batch file. The batch file then copies all files in the directory (C:\test) that are newer then the modified date of the log file to another directory (C:\testTemp).

The log file is located in the same directory as the batch file.


See More: Set date/time of log file as variable

Report •

September 30, 2009 at 14:13:00
@echo off & setLocal EnableDELAYedExpansion

set newer=
for /f "tokens=* delims= " %%a in ('dir/b/a-d/od') do (
if !newer! equ y echo copy "%%a" C:\testTemp
if %%a equ hacstime.log set newer=y

Helping others achieve escape felicity


Report •
Related Solutions

Ask Question