::如果是widnows7系统,可以使用下面的代码
@echo off
set /p dt=请输入日期:
set /p pth=请输入路径:
forfiles /p "%pth%" /m *.* /c "cmd /c del /a /f @path" /d -%dt%
for /f "delims=" %%a in ('dir /a-d /b /s "%pth%"^|sort /r') do (
rd "%%a"
)
pause
@echo off
Setlocal EnableDelayedExpansion
set "dt=%2"&set "y=!dt:~,4!"&set "m=!dt:~4,2!"&set "d=!dt:~-2!"
for %%i in ("%~1") do if "%%~ti" lss "%y%-%m%-%d% 00:00" rd /s/q "%~1"
endlocal
exit/b
另存为1.bat,cmd命令行下输入1.bat c:\123 20150101即可
度娘里多的很啊,搜索批处理程序