When recently upgrading to Windows 7 I had no idea that ripping my CD’s would cause me any trouble. For years I have had the EAC, flacattack.exe and flac.exe files in a directory, making it easy to backup the configuration by simply zipping it.
Moving the package unto Windows 7 - unzipping it into Program Files - I simply fired up EAC and then close to nothing worked. EAC did rip the CD, but flacattack consistently failed to do anything.
This took me by surprise. I spend a couple of hours on it, part of the time in the company of Process Monitor from SysInternals (now part of Microsoft). And finally I figured it out.
The flacattack.ini file was conveniently located in the same directory as flacattack itself, but Windows 7 seems to be pretty strict about any program whatsoever writing anything in Program Files, which is fair enough by itself. Windows 7 then tries to redirect the file write to a so-called VirtualStore (look it up, its probably neat). This means that all my settings were never saved in the actual flacattack.ini that I called flacattack.exe with. Bummer.
When having figured this out I simply moved the ini-file to my Documents directory and would then simply give the entire path (as I did before) on the command line options (they are setup in EAC).
But it still did not work! My Additional command line options in EAC looked like this:
"C:\Users\Torben\Documents\Flac\flacattack.ini" %s "%a" "%t" "%g" "%y" "%n" "%m" %o
One particular point to notice is that %s (the source wav file) is not encapsulated in quotes. Weird. Again I fired up Process Monitor which amongst other stuff gives me information about the command line parameters of a program. Here I could see that the %s, when expanded by EAC, actually DID contain quotes.
I was in trouble here. Because of the move to my Documents folder I needed to pass the full path to the source wav file (%s). I tried various ways of putting "C:\Users\Torben\Documents\Flac\Rip" in front of the %s, but with no luck. I needed to get rid of the initial quote first.
Google to the rescue. I found this website: http://www.dostips.com/DtTipsStringOperations.php which shows how to do more or less simple string operations in a dos batch file. And one of the operations is to remove the start and end characters of a string.
This made me end up with a batch-file (called RunFlacAttack.bat) to call from EAC:
@set inputfile=%2
@set inputfile=%inputfile:~1,-1%
"C:\Program Files (x86)\Exact Audio Copy\flacattack\flacattack.exe" %1 "C:\Users\Torben\Documents\Flac\Rip\%inputfile%" %3 %4 %5 %6 %7 %8 %9
And to call it from EAC the setting "Program, including path, used for compression" is configured to:
C:\Windows\System32\cmd.exe
And the "Additional command line options":
/C C:\Users\Torben\Documents\Flac\RunFlacattack.bat "C:\Users\Torben\Documents\Flac\flacattack.ini" %s "%a" "%t" "%g" "%y" "%n" "%m" %o
And finally I was home free. I did also discover, though, that the directory whereto EAC rips the wavs and the directory where flacattack stores the flac-files should not be the same. This causes flacattack to delete the cue-file before it have used it, causing it to fail. Weird.
Now I can finally rip my backlog of CD’s.