朱科技 当前离线
一级士官
flashercs 当前在线
少校
@echo off setlocal EnableDelayedExpansion cd /d "%~dp0" for /f "delims=" %%A in ('dir /a-d /b *-*') do ( set fn=%%~nxA ren "%%~fA" "!fn:*-=!" ) endlocal pause exit /b复制代码
评分人数
TOP
@echo off cd /d "%~dp0" for /f "tokens=1* delims=-" %%A in ('dir /a-d /b *-*') do ( for /f "tokens=*" %%C in ("%%B") do ( ren "%%A-%%B" "%%C" ) ) pause exit /b复制代码
qixiaobin0715 当前离线
大校
@echo off setlocal enabledelayedexpansion for /f "delims=" %%i in ('dir /b /a-d *-*') do ( set "str=%%i" set "str=!str:* - =!" set "str=!str:*-=!" ren "%%i" "!str!" ) pause复制代码
terse 当前离线
中将
@echo off&setlocal enabledelayedexpansion for /f "delims=" %%i in ('dir /a-d /b *-*') do ( set fn=%%~nxi for /f " tokens=*" %%j in ("!fn:*-=!") do ren "%%~fi" "%%~nxj" ) pause复制代码