回复 2# carsonzhao - @echo off
-
- :main
- set "name=%date:~0,4%_%date:~5,2%_%date:~8,2%_%time:~0,2%_%time:~3,2%"
- set "type=*.txt"
- set "back=D:"
- call:back
- call:clear
- pause
- goto:eof
-
- :back
- rem 备份
- if not exist "%back%\%name%\" md "%back%\%name%\"
- for /R %%i in (%type%) do copy "%%i" "%back%\%name%\"
- goto:eof
-
- :clear
- cd /D "%back%\"
- set times=0
- for /D %%i in (*_*_*_*_*) do set /A times+=1
- echo %times%
- if %times% GEQ 5 for /D %%i in (*_*_*_*_*) do (
- rd /S /Q "%%i"
- goto:eof
- )
- goto:eof
复制代码 你那个感叹号让我一下子很不爽。。。 |