回复 18# lky216
这个呢?
代码如正常显示 去掉最后的 ECHO
运行前先备份- @echo off
- set "fd=20130415000000"
- set "d=d:"
- set "p=\user\"
- set "ext=log"
- for /f "tokens=*" %%p in ('dir /b /ad "%d%%p%"') do (
- for /f "skip=1 tokens=1*" %%i in ('wmic datafile where "drive='%d%' and path='%p:\=\\%%%p\\log\\' and FileName like 'ex%%' and extension='%ext%'" get name^,LastModified') do (
- for /f "tokens=1,2* delims=. " %%a in ("%%i %%j") do (
- if "%%a" lss "%fd%" echo del "%%~fc"
- )
- )
- )
- pause
复制代码
|