(VCSKier, I will speak to you separately via PM, but I thought I'd post these here as a record for others. I'll put them on my site when I get time as well.)
[span style=\'font-size:11pt;line-height:100%\']1. Batch file to convert WV file in situ[/span]
Drag a folder on this batch file and it will process all WV files within the folder or its subfolders. The script uses WVUNPACK to decode the data and pipe it to WAVPACK, which creates a new file called "<name>.new.wv" in the same folder as "<name>.wv". If a problem occurs creating "<name>.new.wv" the script terminates. The script then uses TAG to copy the tags from "<name>.wv" to "<name>.new.wv". Finally "<name>.wv" is deleted and "<name>.new.wv" is renamed to "<name>.wv".
@ECHO OFF
CLS
REM WV-WV.BAT Written by Neil Popham, 2005 (neilpopham@bigfoot.com)
SET batchname=WV-WV.BAT
SET version=1.0.0
TITLE=%batchname%, Version %version%
REM ######################################################
REM PLEASE EDIT THE PATH TO THE EXECUTABLES
REM =====================================================
SET pathToWavPack=WAVPACK.EXE
SET pathToWvUnpack=WVUNPACK.EXE
SET pathToTag=TAG.EXE
REM ######################################################
REM Check whether a valid file or folder has been passed
IF NOT EXIST %1 DO GOTO NoParams
REM Check whether the parameter is a single file or a folder
IF %~z1 NEQ 0 DO GOTO NoParams
REM ======================
REM Process all WV files
REM ======================
FOR /R %1 %%G IN (*.wv) DO CALL :Process "%%G"
REM =====
REM End
REM =====
GOTO:EOF
REM ====================================
REM Process : Process WV file
REM : %1 The WV file to decode
REM ====================================
:Process
ECHO Processing %1
REM Pipe decoded data from WV file to WAVPACK.EXE
%pathToWvUnpack% %1 - | %pathToWavPack% -xm - "%~dpn1.new.wv"
REM If the destination file has been successfully created...
IF EXIST "%~dpn1.new.wv" (
REM Use TAG.EXE to copy the tags from the source file to the destination file
%pathToTag% --fromfile %1 "%~dpn1.new.wv"
REM Delete source file
DEL %1
REM Rename destination file as source file
REN "%~dpn1.new.wv" "%~nx1"
REM Otherwise destination file has not been successfully created
) ELSE (
REM Error occurred
ECHO Error creating new file!
PAUSE >NUL
GOTO:Error
)
REM Return
GOTO:EOF
REM =========================================
REM NoParams : a folder has not been passed
REM =========================================
:NoParams
ECHO To run this script please pass a folder as a parameter.
ECHO.
ECHO Press any key to exit
PAUSE >NUL
REM Exit
:Error
REM Version History
REM ===============
REM 2005-09-28 1.0.0 Initial version
[span style=\'font-size:11pt;line-height:100%\']2. Batch file to create new files in a new folder[/span]
Double-click this batch file and it will process all WV files in "F:\Music" and its subdirectories - copying/processing files to "E:\New" (see configuration) while maintaining full folder structures (so "F:\Music\Pixies\Doolittle\CDImage.wv" will result in "E:\New\Music\Pixies\Doolittle\CDImage.wv"). The script pipes from the source WV to the destination WV, and copies the tags using TAG. It then copies all ".cue" and ".log" files to their respective folders (so "F:\Music\Pixies\Doolittle\CDImage.wv.cue" will be copied to "E:\New\Music\Pixies\Doolittle\CDImage.wv.cue" and "F:\Music\Pixies\Doolittle\Doolittle.log" will be copied to "E:\New\Music\Pixies\Doolittle\Doolittle.log").
@ECHO OFF
CLS
REM WV-WV2.BAT Written by Neil Popham, 2005 (neilpopham@bigfoot.com)
SET batchname=WV-WV2.BAT
SET version=1.0.0
TITLE=%batchname%, Version %version%
REM ######################################################
REM PLEASE EDIT THE PATH TO THE EXECUTABLES
REM =====================================================
SET pathToWavPack=WAVPACK.EXE
SET pathToWvUnpack=WVUNPACK.EXE
SET pathToTag=TAG.EXE
REM ------------------------------------------------------
REM PLEASE EDIT THE PATH TO THE FOLDERS
REM =====================================================
SET sourceFolder=F:\Music
SET destinationFolder=E:\New
REM ######################################################
REM ======================
REM Process all WV files
REM ======================
FOR /R "%sourceFolder%" %%G IN (*.wv) DO CALL :Process "%%G"
REM =======================
REM Process all CUE files
REM =======================
FOR /R "%sourceFolder%" %%G IN (*.cue) DO CALL :CopyFile "%%G"
REM =======================
REM Process all LOG files
REM =======================
FOR /R "%sourceFolder%" %%G IN (*.log) DO CALL :CopyFile "%%G"
REM =====
REM End
REM =====
GOTO:EOF
REM ====================================
REM Process : Process WV file
REM : %1 The WV file to decode
REM ====================================
:Process
REM If the destination directory doesn't exist already create it
IF NOT EXIST "%destinationFolder%%~p1" MKDIR "%destinationFolder%%~p1"
REM Pipe decoded data from WV file to WAVPACK.EXE
%pathToWvUnpack% %1 - | %pathToWavPack% -xm - "%destinationFolder%%~pnx1"
REM Use TAG.EXE to copy the tags from the APE file to the WV file
%pathToTag% --fromfile %1 "%destinationFolder%%~pnx1"
REM Return
GOTO:EOF
REM =================================================
REM CopyFile : Copy file from source to destination
REM : %1 The file to copy
REM =================================================
:CopyFile
REM Copy the file from source to destination, maintaining folder structure
COPY /V %1 "%destinationFolder%%~pnx1"
REM Return
GOTO:EOF
REM Version History
REM ===============
REM 2005-09-29 1.0.0 Initial version
NB: Please test on a test folder before doing anything with your actual archive!
Both scripts have been adapted from my script ape-wv.bat which I'm using to convert my Monkey's Audio archive on DVD to a WavPack archive on hard drive. I am using the pipe-enabled version of MAC available on the shntool site. Being a pedant, I am also using SED in my script to convert CDImage.ape.cue to CDImage.wv.cue (with correct file reference) before re-embedding. My script is available upon request, or just wait until I get around to posting it on my website.