Page 1 of 1

Delete files older than _X_ days

PostPosted: Mon Feb 17, 2014 5:40 pm
by Xander
I've just added this to my D7ShutdownScript to clean up my Ninite folder.

It's running from D7II\Scripts so paths are kept relative.
Code: Select all
REM Delete files older than 30 days
Cd..
Cd "\3rd Party Tools\Custom Apps\NiniteDownloads\"
forfiles /p "Files" /s /d -30 /c "cmd /c del @file : date >= 30 days >NUL"
REm back to D7II folder
Cd..\..\..

Re: Delete files older than _X_ days

PostPosted: Tue Mar 11, 2014 12:27 pm
by Nick
nice!

Re: Delete files older than _X_ days

PostPosted: Tue Mar 11, 2014 7:36 pm
by Xander
Caution - I'm having mixed results with this. The first few runs were flawless and then it would do the "cd" command with a "folder not found" error and then the ForFiles would run godknowswhere and basically hang.