Write file names from multiple dir to a txt

October 30, 2009 at 12:24:22
Specs: Windows XP
What I need to do is search one ROOT DIR (FTP) and find all files listed in any DIR with a filter for MODIFIED DATE > 9/1/2008. I thought to use a batch file, but maybe VBS would work as well. There are MANY DIR's within the FTP ROOT. Then I would need to output the FILENAMES that meet criteria of the DATE to output to a delimited TXT so that I have 'UNCpath|filename|datemodified'

See More: Write file names from multiple dir to a txt

Report •

October 31, 2009 at 00:54:04
from looking in this forum, there's a way to change date format in Xp. (possibly even specific to "dir" cmd). if so, the
easiest way would be change format to yyyy[/]mm[/]dd,
do "dir /s | sort /r > filenam", then just read through the file until the substringim is less than 20080901 or equiv (dep on
delimiter: /,-,etc) then have batchfile change date format back to normal. my guess is that Xp's DIR might even have a
switch to alternative-format date then your batch would not have to change system-wide settings for small-scale op.
i know this not much help. if my Xp system was working i
could be more specific and test some things.

Report •

November 4, 2009 at 22:41:18
the foll. might work (not complete, just working segment)

setlocal enableDelayedExpansion
for /f "tokens=*, delims=" in ('dir /s /tw') do (
set c=%%a
if "!c:~1,13! equ "Directory of " set p=!c:~13,200!

if "!c:~0,1!" neq " " (
set b=!c:~6,4!!c~0,2!!c~3,2!
set f=!c:~39,200!
if "!b!" gtr "20080901" do (
echo !p!, !f!, !b! >> test))

may need a couple other tests to skip the garbage from coming into "test" (the headings etc.)

Report •

Related Solutions

Ask Question