Wednesday, 3 February 2016

Howto: automatically remove files older than x days




Howto: automatically remove files older than ‘x’ days

echo on
rem First Delete old SQL Backup Files
FORFILES /p C:\filename /s /m *.* /d -3 /c “CMD /C del /Q @FILE”
rem pause
Save the script with a .bat or .cmd extension and schedule it using the Windows Scheduled Tasks applet.


No comments:

Post a Comment