I'm trying to find a script in a batchfile that will move log files from one folder to another.
My files are in the named format 20110801.txt, 20110802.txt etc
I want to only move files older than 12 months and I can't use datecreated as all the files were moved to a new server and have the same datecreated/modified stamp from the migration process.
I have to use the date stamp in the file name as my trigger.
I use robocopy(google it, its free) for that exact job. You can place a min date parameter to set what age files you want. PM me if you want a copy of the batch file.
Or maybe just use wildcards in the file name for now?
Pierre
Edited by - pierretopping on 11 September 2011 16:03:53
The way I'd do it in ASP would be to use the FSO to loop through all the files, convert each file name to date format, use datediff to compare that date to today's date and move the file if datediff is more than 12 months. Don't know much about batch files but the process, at least, should be the same.
Search is your friend “I was having a mildly paranoid day, mostly due to the fact that the mad priest lady from over the river had taken to nailing weasels to my front door again.”