说的也是,忘记P也在那个文件夹里面,如果我那个P文件名超过6位置的,也会把自身move进去~!
加多一个if- @echo off&setlocal enabledelayedexpansion
- for /f "delims=" %%i in ('dir/b') do (set a=%%i&set a=!a:~6,2!
- if defined a (if !a! leq 31 (
- if exist !a! (move "%%i" !a!) else (md !a!&move "%%i" !a!))))
复制代码 其实把3楼的P做小小的修改可以啦,方法还不错呢!呵呵,学习了- @echo off&setlocal enabledelayedexpansion
- for /l %%i in (1,1,31) do (
- set i=0%%i
- md "!i:~-2!" 2>nul
- move "??????!i:~-2!_*.*" "!i:~-2!" >nul 2>nul
- )
复制代码
|