-1
Ok, I know the loop part is invalid, but hopefully helps give an idea of what I want to do. Ultimately, I want to get prompted for the 3 values (commented out the prompts for now and hard coding for ease of testing), then I want it to run through the loop once per CD (so 8 times in this example). I want it to name the .mp3 file with an incrementing CD#... CD1, CD2, CD3, etc. If anyone has any improvements, those are welcome too! I'm posting my full code here to share with the community.
@ECHO OFF
REM set /p BookName="Book Name: "
REM set /p AuthorName="Author Name: "
REM set /p CDNumber="Number of CDs: "
set BookName=Victory and Honor
set AuthorName=W.E.B. Griffin
set CDNumTot=8
set PathName=C:\Rip\%AuthorName%\%BookName%
mkdir "C:\Rip\%AuthorName%\%BookName%\"
REM cd C:\Program Files (x86)\freac
ECHO CD Count: %CDNumTot%
FOR /L %%N IN (1, 1, %CDNumTot%) DO (
Set FileName=%PathName%\%BookName% CD%%N.mp3
ECHO Filename: %FileName%
ECHO\
ECHO Ripping CD# %%N...
ECHO freaccmd -track all -o %FileName%
ECHO CLS
ECHO\
ECHO\
set /A NextCD=%%N
ECHO Next: %NextCD
ECHO Please Eject CD and insert next CD# %NextCD%...
pause
)
Final version of this code (WORKING thanks to @JoeNahmias):
@ECHO OFF
SETLOCAL ENABLEEXTENSIONS ENABLEDELAYEDEXPANSION
set /p BookName="Book Name: "
set /p AuthorName="Author Name: "
set /p CDNumTot="Total number of CDs: "
set PathName=C:\Rip\%AuthorName%\%BookName%
FOR /L %%N IN (1, 1, %CDNumTot%) DO (
cls
ECHO\
ECHO Please insert CD# %%N...
ECHO\
pause
SET FileName=%PathName%\%BookName% CD%%N.mp3
cls
ECHO\
ECHO Ripping CD# %%N...
ECHO\
"C:\Program Files (x86)\freac\freaccmd" -track all -o "!FileName!"
REM You need the id3 executable downloaded/installed for the next line:
REM id3 -l "!BookName!" -a "!AuthorName!" -n %%N "!FileName!"
rundll32 user32.dll,MessageBeep -1
ECHO\
ECHO Please eject CD# %%N...
pause
)
cls
ECHO\
ECHO DONE!
pause
-1 for editing the question to remove the original question. – Scott – 2019-03-08T20:45:56.760
Updated it for current version, based on @JoeNahmias sample, but seems that I can't fully read the variables in the code or create a temp incremental value within the loop (Prompting for next numbered CD...). – BondUniverse – 2014-05-02T17:54:17.293
Most importantly though, the 'Set FileName=%PathName%%BookName% CD%%N.mp3' line comes out blank... – BondUniverse – 2014-05-02T17:54:59.567