千家信息网

Windows bat批量删除备份脚本

发表于:2025-01-31 作者:千家信息网编辑
千家信息网最后更新 2025年01月31日,@echo offgoto startFilename: del_backup.batVersion: V3.0Author: XADBlog Site: https://blog.51cto.com
千家信息网最后更新 2025年01月31日Windows bat批量删除备份脚本
@echo offgoto startFilename: del_backup.batVersion: V3.0Author: XADBlog Site: https://blog.51cto.com/oneniceCreated Time: 2018/02/13 周二  14:52:58.00Environment: windows server 2008:startset file_path=E:\set file_ext=*.bkfset file_live_time=-15set 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%


0