gdPAC
asked on
Script needed to report on old files
I need a script or freeware utility that will report on all files older than "n" days in a Windows 2000 directory tree with the following structure:
documents
+user
+my documents
+user's local store
I want to scan all folders under "documents" matching "*local store\" and list all files in those folders that are older than a specified date with relative paths back to "user's local store\" along with the modified date to a text file. I've gotten close with FORFILES but it includes ALL subfolders in the tree instead of just the "local store" folders.
Example output:
FILES OLDER THAN 30 DAYS
Glen's Local Store\HAL9000.src 10/10/2007
Harold's Local Store\Secrets of the Universe.csv 3/27/1962
Harold's Local Store\LOTR.wav 2/2/2008
Thanks!
Glen
documents
+user
+my documents
+user's local store
I want to scan all folders under "documents" matching "*local store\" and list all files in those folders that are older than a specified date with relative paths back to "user's local store\" along with the modified date to a text file. I've gotten close with FORFILES but it includes ALL subfolders in the tree instead of just the "local store" folders.
Example output:
FILES OLDER THAN 30 DAYS
Glen's Local Store\HAL9000.src 10/10/2007
Harold's Local Store\Secrets of the Universe.csv 3/27/1962
Harold's Local Store\LOTR.wav 2/2/2008
Thanks!
Glen
ASKER
That works, but it doesn't scale well. I didn't run a timer, but it took well over 20 minutes to generate a report. It would be much more efficient to crawl a tree looking for a specified string ("local store" in this case) in the path name and then add lines to a text file of the relative path\file names that meet the age criteria.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Works GREAT! Thanks for the help.
No problem. Thanks for the grade.
Regards,
Rob.
Regards,
Rob.
Local Store\
in it?
Regards,
Rob.
Open in new window