Very nice idea. I also have a couple of VBScripts that I've developed and use for essentially the same thing. Like yours they utilize external EXEs - flac, metaflac, LAME, metamp3, touch.
I have mine as two different scripts:
2flac.vbs - Will "re-flac" Flacs, encode WAVs to Flac, and transcode APE files to Flac. I use it mostly to re-encode downloaded Flacs to my desired compression level and to transcode APEs. Integrated into Windows Explorer with a couple simple registry additions, just right-click the folder and select '2flac'.
flac2mp3.vbs - Transcodes Flac folder (or entire tree) to Mp3. Used for keeping a mirror Mp3 library of my Flac library for portable players. Unlike 2flac, which most often puts the output files in the same folder, flac2mp3 will have a separate output folder. I run it nightly to pick up any new or edited Flacs and mirror them in the Mp3 library. It examines file timestamps to determine if a Flac file is new or changed and it skips any where the Mp3 and the Flac have the same mtime.
- Tag v2.0.52 Makes use of Tag to identify and remove ID3v2 tags.
If this is for the Flac files, I found this wasn't necessary. I occasionally run into Flacs with id3v2 tags (damned EAC). If you attempt to use Flac's native re-encoding you'll get an error. But you can examine the program's exit code and then use the conventional (slower) process of decoding to WAV and then encoding the WAV to Flac.
' If installed Flac version is >= 1.1.3, use native re-encoding
If FlacVersion >= "1.1.3" Then
exitcode = shell.Run("""" & flac & """ " & flacoptions & " -f -s -o """ & ofile & """ """ & ifile & """", 0, True)
End If
' If older Flac version, or if the above attempt failed, use old method
If (FlacVersion < "1.1.3") Or (exitcode <> 0) Then
Set tags = GetFlacTags(ifile)
tmpwavfile = fso.BuildPath(fso.GetParentFolderName(ofile), fso.GetBaseName(ofile) & ".wav")
exitcode = shell.Run("""" & flac & """ -d -f -s -o """ & tmpwavfile & """ """ & ifile & """", 0, True)
Wav2Flac tmpwavfile, ofile, tags
End if