- @echo off
-
- for /f "delims=" %%z in ('dir/b/ad')do set "#z=%%z"
- echo 最后一个目录名:[%#z%]
- for /f "tokens=1-2 delims=0123456789" %%d in ("%#z%")do set "#y=%%d%%e"
- echo 非数字:[%#y%]
- for /f "delims=%#y%" %%s in ("%#z%")do set/a "#s=1%%s+1"
- echo 数字递增:[%#s%]
- set "bookName=任务%#s:~-3% 0"
- echo 新书目录名:[%bookName%]
-
- md "%bookName%"
- goto :eof
复制代码
|