序号后面是空格的话
稍微改一下就好- @echo off
- setlocal enabledelayedexpansion
-
- set _path_=c:
- for /f "tokens=* delims=" %%a in ('dir /b /a-d %_path_%\*.txt') do (
- for /f "tokens=1 delims= " %%a in ("%%a") do set "n=%%a"
- set /a "n1=((n-1)/20)*20+1"
- set /a "n2=((n-1)/20)*20+20"
- if not exist !n1!-!n2! md !n1!-!n2!
- move "%%a" "!n1!-!n2!"
- )
复制代码
|