Jump to content

I need a script to delete files older than 7 days


Recommended Posts

Posted (edited)

As per title really, i need a script that i can setup to run daily on a task schedule which will delete files from a set folder that are older than 7 days, does anyone have anything like that to hand?

 

EDIT: Nevermind!

 

Seems while similar threads didn't pop up with anything and search didn't display it, google on the otherhand pointed me to another edugeek thread lol

 

using this is working a treat:

FORFILES /P "E:\SQL Backups\Sims Backups" /S /M *.* /D -8 /C "CMD /C del /Q @file"

FORFILES /P "E:\SQL Backups\FMS Backups" /S /M *.* /D -8 /C "CMD /C del /Q @file"

 

:)

 

EDIT2: sorry whoever fil is, not meant to be a mention, but "@ file" apparently points to you lol

Edited by mrbios

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...