+ Post New Thread
Results 1 to 3 of 3
Scripts Thread, Delete Files Older Than x Days - ForFiles.exe - Script Issues in Coding and Web Development; Hi, I'm having a little issue with a batch script that I've managed to create, using information from various posts ...
  1. #1
    gtg93's Avatar
    Join Date
    May 2010
    Posts
    298
    Thank Post
    174
    Thanked 38 Times in 30 Posts
    Rep Power
    15

    Delete Files Older Than x Days - ForFiles.exe - Script Issues

    Hi,

    I'm having a little issue with a batch script that I've managed to create, using information from various posts and forums on the web but can't quite get it right.

    Can anyone offer any help?

    I'm wanting the script to check a folders contents by the age and delete anything over 5 days old, the script I have at the minute is as follows:

    forfiles /p "Insert Directory Within the quotation marks" /s /D -10 /M *.* /C "cmd /C del @path /Q"

  2. #2

    Join Date
    Dec 2007
    Location
    cumbria
    Posts
    182
    Thank Post
    7
    Thanked 43 Times in 39 Posts
    Rep Power
    25
    Here's a line from one of my scripts, that's working fine :-

    forfiles /P Z: /M "*.BKF" /D -21 /C "CMD /C DEL @FILE"

    Z: is the path
    *.BKF is the 'mask' -
    -21 - 3 weeks is what we're keeping in this case.

    Hope this is of some use.

  3. Thanks to tumbleweed from:

    gtg93 (13th January 2011)

  4. #3
    gtg93's Avatar
    Join Date
    May 2010
    Posts
    298
    Thank Post
    174
    Thanked 38 Times in 30 Posts
    Rep Power
    15
    Quote Originally Posted by tumbleweed View Post
    Here's a line from one of my scripts, that's working fine :-

    forfiles /P Z: /M "*.BKF" /D -21 /C "CMD /C DEL @FILE"

    Z: is the path
    *.BKF is the 'mask' -
    -21 - 3 weeks is what we're keeping in this case.

    Hope this is of some use.
    Cheers for that

    Managed to get it working with a VBS now though

SHARE:
+ Post New Thread

Similar Threads

  1. Replies: 5
    Last Post: 1st July 2014, 08:34 AM
  2. 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
  3. Replies: 6
    Last Post: 26th September 2008, 03:57 PM
  4. Outlook 2007 - no email older than 90 days?
    By theeldergeek in forum How do you do....it?
    Replies: 8
    Last Post: 13th May 2008, 09:38 AM
  5. Script to delete certain files
    By tri_94 in forum Scripts
    Replies: 9
    Last Post: 30th April 2008, 04:56 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
  •