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 ...
11th January 2011, 03:22 PM #1
Delete Files Older Than x Days - ForFiles.exe - Script Issues
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"
13th January 2011, 12:21 PM #2
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.
Thanks to tumbleweed from:
gtg93 (13th January 2011)
13th January 2011, 01:28 PM #3
Cheers for that
Originally Posted by tumbleweed
Managed to get it working with a VBS now though
By Oops_my_bad in forum Scripts
Last Post: 23rd January 2009, 12:21 AM
By scotimus in forum Scripts
Last Post: 26th September 2008, 04:57 PM
By theeldergeek in forum How do you do....it?
Last Post: 13th May 2008, 10:38 AM
By tri_94 in forum Scripts
Last Post: 30th April 2008, 05:56 PM
Last Post: 18th January 2008, 02:46 PM
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)