forfiles /p "c:" /s /m *.txt /c "cmd /c echo @file is a txt file, file path is @relpath , file size is @fsize , file modified date is @fdate , @ftime"
@echo off
rem IIS日志文件
set log_dir="C:\inetpub\logs\LogFiles"
rem 保留天数
set bak_dat=7
forfiles /p %log_dir% /S /M *.log /D -%bak_dat% /C "cmd /c echo 正在删除@relpath 文件... & echo. & del @file"
通过计划任务来删除对应的日志问题即可