 
- 帖子
- 6
- 积分
- 296
- 技术
- 0
- 捐助
- 0
- 注册时间
- 2008-8-3
|
@title 更名
@echo off
color 1f
setlocal EnableDelayedExpansion
:kaishi
set /p dir=请输入路径 格式: X:\..\.. 例如 c:\music)
if exist %dir%\*.mp3 (for %%i in (%dir%\*.mp3) do (echo %%i >>tmp.txt)) else (echo 路径错误或*.mp3不存在&goto kaishi)
for /f "delims=\-. tokens=1,2,3,4,5,6,7,8,9" %%a in (tmp.txt) do echo %%a %%b %%c %%d %%e %%f %%g %%h %%i %%j %%k %%l %%m %%n %%o %%p %%q %%r %%s %%t %%u %%v %%w %%x %%y %%z >>1.txt
for /f "delims=%%" %%a in (1.txt) do (echo %%a >>2.txt)
for /f "delims=," %%a in (2.txt) do (
set /a s=0
for %%i in (%%a) do set /a s=!s!+1
set /a s1=!s!-2
set /a s2=!s!-1
)
for /f "tokens=%s1%,%s2%" %%a in (2.txt) do (ren "%dir%\%%a - %%b.mp3" "%%b - %%a.mp3" 2>nul
ren "%dir%\%%a-%%b.mp3" "%%b-%%a.mp3" 2>nul
)
del 1.txt
del 2.txt
del tmp.txt
set /p a=文件名已经更改完毕<nul
pause
start %dir%
exit |
-
1
评分人数
-
|