Extract from newest .log file

Microsoft WINDOWS XP
July 22, 2009 at 07:41:42
Specs: Windows XP
I'm trying to extract some information from a .log file. But there are new log files each time this certain software opens. So I'm trying to find a way to just get some of the information from that newest .log file stored in a log folder. They're named "server-2009-07-22.log" for example, but there could be multiple each day, just adding a _2 or _3 etc. at the end... Any ideas? I've learned a lot from this website, so I decided to start here.

See More: Extract from newest .log file

Report •

July 22, 2009 at 09:44:20
@echo off & setLocal EnableDELAYedExpansion

for /f "tokens=* delims= " %%a in ('dir/b/o-d') do (
set newest=%%a
goto :got it
:got it
echo newest is !newest!

If at first you don't succeed, you're about average.


Report •
Related Solutions

Ask Question