title: CMD: extract part of a filename and use it as variable
body: <p>I ripped my CDs with EAC to CUE+WAV files, added cover art and all my files are in the same folder with filenames pattern "Album artist - Album title", for ex.:</p>
  
  <pre><code>Clannad - Legend.wav/cue/jpg
  David Bowie - Best Of Bowie [Disc 1].wav/cue/jpg
  David Bowie - Best Of Bowie [Disc 2].wav/cue/jpg
  </code></pre>
  
  <p>I'm new to this so I wrote a simple CMD batch to convert my music to FLAC format, but it requires manual copying and pasting of the actual wav/cue/jpg filenames and input of album artist, disc no. and total disc no. for their corresponding tags. It cannot be stored in cuesheet file for some reason, but in my case I have them in filenames as you can see above).</p>
  
  <pre><code>ECHO WAV/CUE/JPG FILENAME
  SET /P "input="
  ECHO ALBUMARTIST
  SET /P "albumartist="
  ECHO DISCNUMBER
  SET /P "discnumber="
  ECHO TOTALDISCS
  SET /P "totaldiscs="
  
  flac.exe -0 --picture="D:\Music\%input%.jpg" --tag-from-file="CUESHEET=D:\Music\%input%.cue" -T "ALBUMARTIST=%albumartist%" -T "DISCNUMBER=%discnumber%" -T "TOTALDISCS=%totaldiscs%" "D:\Music\%input%.wav"
  </code></pre>
  
  <p>My question is about automation of converting all my ripped albums. How can I extract album artist/disc no./total disc no. info from filenames and loop that for every .wav file?</p>