Simple delete folder script
Posted on 2013-02-05
Hello, I'm looking for a script .bat or .vbs (something that will easily work with task scheduler) that will delete a folder that is at least one day old (or anything but the current day) with a specific name. Here's my scenario.
I have many old anti-virus folders getting archived with the date as the folder name here are 3 folder I have currently in my directory and I would like to have a script that deletes the other two - I DO NOT WANT TO DELETE ANY OF THE OTHER FOLDERS IN THAT DIRECTORY. With the 3 folders below it would delete #'s 1. and 2.
1. 20130130 (Date modified 1/31)
2. 20130201 (Date modified 2/2)
3. 20130202 (Date modified 2/3)
I would like to run this script every morning, I'm assuming we can do something like (2013*) for the name piece?