这个批处理怎么改为该文件夹的所有文件添加序号?
@echooff&cd/d%~dp0&set/an=1000setlocalenabledelayedexpansionfor/f"tokens=1*delims=_"%...
@echo off&cd/d %~dp0&set/a n=1000
setlocal enabledelayedexpansion
for /f "tokens=1* delims=_" %%i in (
'dir/b/a-d *.mp3^|findstr/b "[0-9][0-9]*_"')do ren "%%i_%%j" "%%j"
for %%i in (*.mp3)do set "#!random!=%%i"
for /f "tokens=1* delims==" %%i in ('set #')do (
set/a n+=1
echo !n:~1!_%%j
ren "%%j" "!n:~1!_%%j"
)
set/p=按任意键容退出... <nul&pause>nul 展开
setlocal enabledelayedexpansion
for /f "tokens=1* delims=_" %%i in (
'dir/b/a-d *.mp3^|findstr/b "[0-9][0-9]*_"')do ren "%%i_%%j" "%%j"
for %%i in (*.mp3)do set "#!random!=%%i"
for /f "tokens=1* delims==" %%i in ('set #')do (
set/a n+=1
echo !n:~1!_%%j
ren "%%j" "!n:~1!_%%j"
)
set/p=按任意键容退出... <nul&pause>nul 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询