- @echo off
- cd /d "%~dp0"
- for /f "delims=" %%i in ('dir /b /a-d *.mp3 *.lrc "*. lrc"') do (
- call :1 "%%~ni" "%%~xi"
- )
- pause & exit
-
- :1
- set str=%~1
- setlocal enabledelayedexpansion
- for /l %%l in (1,1,5) do (
- set "str=!str: -=-!"
- set "str=!str:- =-!"
- )
- endlocal & set str=%str%
- for /f "tokens=1-2 delims=-" %%a in ("%str%") do (
- ren "%~1%~2" "%%b - %%a%~2"
- echo ren "%~1%~2" "%%b - %%a%~2"
- )
- exit /b
复制代码
|