@echo off goto start Filename: del_backup.bat Version: V3.0 Author: XAD Blog Site: https://blog.51cto.com/onenice Created Time: 2018/02/13 周二 14:52:58.00 Environment: windows server 2008 :start set file_path=E:\ set file_ext=*.bkf set file_live_time=-15 set file_del_log=D:\del_log.txt echo ============================================================================ >> %file_del_log% echo= >>%file_del_log% echo %date% - %time% [BEGIN] >> %file_del_log% echo= >> %file_del_log% forfiles /p %file_path% /s /d %file_live_time% /m %file_ext% /c "cmd /c echo @path SIZE:@fsize L_C_TIME:@fdate-@ftime >> %file_del_log%" forfiles /p %file_path% /s /d %file_live_time% /m %file_ext% /c "cmd /c del @path" echo= >> %file_del_log% echo %date% - %time% [END] >> %file_del_log% echo= >> %file_del_log%
转载于:https://blog.51cto.com/onenice/2071529