|
本帖最后由 pznpt 于 2013-9-12 21:16 编辑
- @echo off
- %1mshta vbscript:createobject("wscript.shell").run("""%~0"" : "^&Right(Year(Date-3),2)^&"-"^&Right("0"^&Month(Date-3),2)^&"-"^&Right("0"^&Day(Date-3),2))(close)&exit /b
- pushd "G:\BAK"
- set "re=[0-9][0-9]\-[0-9][0-9]\-[0-9][0-9]"
- for /f "delims=" %%a in ('dir /ad /b^|findstr /x "%re%"') do if "%%a" lss "%2" echo rd /s /q "%%a"
- pause
复制代码 测试无误后再删掉第6行的echo |
|