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

Both sides previous revision Previous revision
Next revision
Previous revision
computing:windows:del_files_older [2011/11/07 13:00]
gcooper
computing:windows:del_files_older [2011/11/07 13:10] (current)
gcooper
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>
  
-Syntax for Windows 2008:+To test it first, this will print out each file that you will be deleting:
  
 <file> <file>
-forfiles /P "C:\Mysql_backup" /S /M *.sql /D -30 /C "cmd /c del @PATH"+forfiles -p z:\backup -s -m *.-d -3 -c "cmd /C Echo 0x22@Path\@File0x22"
 </file> </file>
  
-To test it first, use this:+Syntax for Windows 2008:
  
 <file> <file>
-forfiles -p z:\backup -s -m *.-d -3 -c "cmd /C Echo 0x22@Path\@File0x22"+forfiles /P "C:\Mysql_backup" /S /M *.sql /D -30 /C "cmd /c del @PATH"
 </file> </file>
  
-This will print out each file that you will be deleting. 
computing/windows/del_files_older.1320696037.txt.gz · Last modified: 2011/11/07 13:00 by gcooper