Script to delete all files more then a week old

From Visual Basic to GNU C, this is the place to talk programming.

Moderators: SecretSquirrel, just brew it!

Script to delete all files more then a week old

Postposted on Mon Dec 20, 2010 3:51 pm

Total code newb here (apart from HTML/CSS but that hardly counts).

I need a script to delete all files older then a week from a certain directory and all it's subdirs, but not the folders themselves. I want it to work on XP and 7, since it needs to recognise the date that files were created I believe this means I'm looking at a VBScript.

Thought I'd post here and ask if anyone has such a script? Seems like a fairly common, simple task. If not I'll attempt to hack one together myself from what Google turns up and post what I come up with. Might be of use to some others.
Intel Core i5-4670K | Asus Z87-A | G.Skill 8GB 2400MHz CL10 | Asus DirectCU II R9 290 4GB | Samsung 840 120GB |Thermalright Macho | Lancool PC-K59
puppetworx
Gerbil XP
Silver subscriber
 
 
Posts: 494
Joined: Tue Dec 02, 2008 5:16 am

Re: Script to delete all files more then a week old

Postposted on Mon Dec 20, 2010 4:43 pm

Working for me too, beautiful!

Was just starting to learn the basics when I saw you'd posted this. One of these days I will actually have to learn how this stuff works though. One of these days.

Sure more people will dig this too, thanks man!
Intel Core i5-4670K | Asus Z87-A | G.Skill 8GB 2400MHz CL10 | Asus DirectCU II R9 290 4GB | Samsung 840 120GB |Thermalright Macho | Lancool PC-K59
puppetworx
Gerbil XP
Silver subscriber
 
 
Posts: 494
Joined: Tue Dec 02, 2008 5:16 am


Return to Developer's Den

Who is online

Users browsing this forum: No registered users and 2 guests