+ Post New Thread
Results 1 to 1 of 1
Scripts Thread, I need a script to delete files older than 7 days in Coding and Web Development; As per title really, i need a script that i can setup to run daily on a task schedule which ...
  1. #1
    mrbios's Avatar
    Join Date
    Jun 2007
    Location
    Stroud, Gloucestershire
    Posts
    2,448
    Thank Post
    349
    Thanked 255 Times in 210 Posts
    Rep Power
    98

    I need a script to delete files older than 7 days

    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
    Last edited by mrbios; 17th November 2011 at 09:12 AM.

SHARE:
+ Post New Thread

Similar Threads

  1. Script to Delete Files and folders within a folder
    By doddsworthy in forum Scripts
    Replies: 17
    Last Post: 17th June 2011, 09:44 AM
  2. Replies: 28
    Last Post: 23rd May 2011, 09:57 AM
  3. Replies: 2
    Last Post: 13th January 2011, 12:28 PM
  4. A script to delete files created by certain owners
    By Oops_my_bad in forum Scripts
    Replies: 2
    Last Post: 22nd January 2009, 11:21 PM
  5. need a script to delete shortcuts
    By philtomo-25 in forum Scripts
    Replies: 2
    Last Post: 1st November 2007, 03:50 PM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •