6 replies
by chris910
what is the structure of the filename?
Are there other files in the folder besides the ones you want to delete?
by tbwolfe
Chris -- you answered the question with a question. There are multiple files created on a daily basis with the file name being about 18 characters, with the last 10 charaters being different - it is the date code. So, can I write a script that tells it to compare the date of the file with today's date and delete if it is greater then 7 days old?
by normandhome
by shawn
I think the best way would be to write a .vbs script that:
-creates a variable for the date in the required format
-inventories the contents of your folder (using the FileSystemObject object)
-compares the last 10 characters of the file names with the date variable and deletes the ones that are older than you want to keep
You could then schedule this script to run once a day with the task scheduler.
Kinda vauge, I know, but I will look at the actual syntax required when I get a free moment (busy at work with a domain migration right now :oS )
Cheers,
Shawn
by tbwolfe
Poster rated this answer.
by tbwolfe
This discussion is closed to new replies.
Trending Windows Forum posts
Sort by Trending