REM -------------------------------------------------------
REM 对某一个目录下的特定音乐生成CUE文件 Ver 2.0
REM -------------------------------------------------------
@echo off
REM -----------设置检查目录-输入绝对路径-------------------
set _SCANPATH=D:\Music\MP3\Serebro_2012.06.19.[Mama Lover]
set _FINDEXT=*.mp3 *.wav *.flac *.ape
set OUT_NAME=%_SCANPATH%\_list.cue
REM -----------输入的部分----------------------------------
set _PERFORMER=群星
set _TITLE=
set _DATE=2012
set _START_POS=4
REM _START_POS 如果文件名前面 "01 童话" 去掉 "01 " 时选择 3
REM -------------------------------------------------------
set /a iLine=0
setlocal enabledelayedexpansion
for /R "%_SCANPATH%" %%N in (%_FINDEXT%) do (
REM @echo %cd%\ 当前目录名
REM @echo %%~dN%%~pN 搜索目录名
REM %%~nN%%~xN 文件名+扩展名
set _PATH=%%~dN%%~pN
REM %%~dN%%~pN 去掉后面的 "\" 因为 cd 里没有"\"
set _PATH=!_PATH:~0,-1!
REM 不检查子目录
REM if !cd! EQU !_PATH! (
if "!_SCANPATH!" EQU "!_PATH!" (
set /a iLine=!iLine!+1
REM 如果没有不生成CUE文件
if !iLine! EQU 1 (
@echo REM DATE !_DATE!>"!OUT_NAME!"
@echo PERFORMER "!_PERFORMER!">>"!OUT_NAME!"
@echo TITLE "!_TITLE!">>"!OUT_NAME!")
if !iLine! lss 10 ( set tn=0!iLine! ) else ( set tn=!iLine!)
REM 最多99 否则认为无效CUE文件格式
if !iLine! EQU 100 goto END
REM @echo %%~nN%%~xN
@echo FILE "%%~nN%%~xN" WAVE>>"!OUT_NAME!"
@echo TRACK !tn! AUDIO>>"!OUT_NAME!"
set name=%%~nN
@echo TITLE "!name:~%_START_POS%!">>"!OUT_NAME!"
@echo PERFORMER "!_PERFORMER!">>"!OUT_NAME!"
@echo FLAGS DCP>>"!OUT_NAME!"
@echo INDEX 01 00:00:00>>"!OUT_NAME!"
))
:END
@echo *** Find !iLine! files ***
@pause>nul
notepad "!OUT_NAME!"
REM -------------------------------------------------------