BAT脚本删除指定路径指定日期文件

版权声明:本文为博主原创作品,转载请声明出处! https://blog.csdn.net/u011086209/article/details/85089903

::删除指定路径图片资源,(+/-)(日期之后/日期之前)
::指令 deleteImage.bat C:\Users\Administrator\Desktop\TestImage jpg +2018/12/01
@echo off
::C:\Users\Administrator\Desktop\TestImage\
set file_path=%1
::jpg
set img_suffix=%2
::+2018/12/01
set img_date=%3
if exist %file_path% (
    echo file path is find!
    forfiles /p %file_path% /s /m *.%img_suffix% /d %img_date% /c "cmd /c del /f /q /a @path"
    echo delete is success
) else (
    echo file path is not found!
)
pause>nul

猜你喜欢

转载自blog.csdn.net/u011086209/article/details/85089903