gtg93 Posted January 11, 2011 Posted January 11, 2011 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"
tumbleweed Posted January 13, 2011 Posted January 13, 2011 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. 1
gtg93 Posted January 13, 2011 Author Posted January 13, 2011 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
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now