User Tools

Site Tools


computing:windows:del_files_older

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
computing:windows:del_files_older [2011/11/07 12:57]
gcooper created
computing:windows:del_files_older [2011/11/07 13:10] (current)
gcooper
Line 1: Line 1:
-====== Delete Files Older Than ======+====== Delete Files Older Than X Days on Windows======
  
 http://stackoverflow.com/questions/51054/batch-file-to-delete-files-older-than-n-days http://stackoverflow.com/questions/51054/batch-file-to-delete-files-older-than-n-days
Line 5: Line 5:
 http://forums.devshed.com/windows-help-34/deleting-files-older-than-14-days-using-batch-file-script-364137-2.html http://forums.devshed.com/windows-help-34/deleting-files-older-than-14-days-using-batch-file-script-364137-2.html
  
-This will delete all files in my backup directory older than 3 days:+This will delete all files in backup directory older than 3 days:
  
 <file> <file>
Line 11: Line 11:
 </file> </file>
  
-To test it first, use this:+To test it first, this will print out each file that you will be deleting:
  
 <file> <file>
Line 17: Line 17:
 </file> </file>
  
-This will print out each file that you will be deleting.+Syntax for Windows 2008: 
 + 
 +<file
 +forfiles /P "C:\Mysql_backup" /S /M *.sql /D -30 /C "cmd /c del @PATH" 
 +</file> 
computing/windows/del_files_older.1320695877.txt.gz · Last modified: 2011/11/07 12:57 by gcooper