881966 当前离线
一级士官
@echo off for /f "delims=" %%a in ('dir /a-d/s/b^|findstr ", _"') do ( for /f "tokens=1-3 delims=,_" %%i in ("%%~nxa.*") do ren "%%a" "%%i_%%l.*" ) pause复制代码
评分人数
qixiaobin0715 当前离线
大校
@echo off setlocal enabledelayedexpansion for /f "delims=" %%a in ('dir /s /b /a-d "*,*_*.*"') do ( for /f "tokens=1* delims=," %%i in ("%%~nxa") do ( set str=%%j ren "%%a" "%%i_!str:*_=!" ) ) pause复制代码
TOP
hfxiang 当前在线
上尉
@for /f "delims=" %%a in ('dir /a-d/s/b') do @for /f "delims=" %%b in ('echo;%%a^|sed -r "s/[,,].*_/_/"') do @if "%%~fa" NEQ "%%~fb" @move /y "%%~fa" "%%~fb"复制代码