mqa3 当前离线
列兵
评分人数
ppll2030 当前离线
四级士官
@echo off for /l %%n in (1, 1, 100) do ( for /f "delims=" %%i in ('dir /b /s /a-d "阶段*_*"^|findstr /irc:".*_%%n"') do ( if not exist %%n md %%n move "%%i" "%%n\" ) ) pause复制代码
TOP
qixiaobin0715 当前在线
大校
@echo off md "NewFolder" setlocal enabledelayedexpansion for /f "delims=" %%i in ('dir /b /s /a-d "阶段*_*.*"') do ( for /f "tokens=1* delims=_" %%j in ("%%~nxi") do ( set n=00%%~nk set n=!n:~-3! copy "%%i" "NewFolder\!n!_%%j%%~xi" ) ) pause复制代码
@echo off for /f "delims=" %%i in ('dir /s /b /a-d *.xls') do ( for /f "tokens=2 delims=_" %%j in ("%%~ni") do ( md "%%j" 2>nul copy "%%i" "%%j\">nul ) ) pause复制代码