Windows bat批量刪除備份腳本
阿新 • • 發佈:2018-02-13
create path 8.0 author files %d bsp nice art @echo off
goto start
Filename: del_backup.bat
Version: V3.0
Author: XAD
Blog Site: http://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%
Windows bat批量刪除備份腳本