本帖最后由 aloha20200628 于 2023-12-25 18:09 编辑
回复 23# yanni_enya
新版本在已播放列表文件中加入行首序号。- @echo off &setlocal enabledelayedexpansion
- set "i=0" &set "7F=D:\jhrw\现用音乐\music\list.7"
- if not exist "!7F!" (cd.>"!7F!") else for /f %%k in ('find /v /c "" ^<"!7F!" ') do (set "i=%%k" &if %%k geq 7 (cd.>"!7F!"))
- for %%b in ("D:\jhrw\现用音乐\music\*.bat") do (set/a "n+=1" &set "$!n!=%%b")
- :[Loop]
- set/a m=%random%%%%n%+1
- for %%k in (!m!) do (set "mF=!$%%k!")
- find /i "!mF!" "!7F!">nul && goto[Loop]
- set/a "i+=1" &echo,!i!: !mF!>>"!7F!"
- start "" "!mF!"
- endlocal &exit/b
复制代码
|