I'd love to get a copy of your batch files and the script to rename the image files. I'm working on similar scripts that work with flac files.[{POST_SNAPBACK}][/a]
I am at work now, but I will upload my batch files tonight if I can (I have a newborn and things are pretty crazy right now!).
To create valid folder/file names from any parameter I have created the following "function" (I'm not familiar with batch file programming, so this may be poor practice), which takes a string and replaces any invalid character (in theory) with a space (as EAC seems to):
:MakePath
SET tmpString=%~1
SET tmpString=%tmpString:/= %
SET tmpString=%tmpString:\= %
SET tmpString=%tmpString::= %
SET tmpString=%tmpString:?= %
SET tmpString=%tmpString:"= %
SET tmpString=%tmpString:^<= %
SET tmpString=%tmpString:^>= %
SET tmpString=%tmpString:^|= %
REM Now remove asterisks...
SET tmpString=%tmpString: =/%
SET tmpString=%tmpString:,=\%
SET output=
SET /A counter=-1
:MakePathNextChar
SET /A counter+=1
CALL :EXEC SET char=%%tmpString:~%counter%,1%%%
if NOT DEFINED char GOTO :MakePathDone
if [%char%] EQU [*] SET char=/
SET output=%output%%char%
GOTO :MakePathNextChar
:MakePathDone
SET output=%output:/= %
SET output=%output:\=,%
SET %2=%output%
GOTO:EOF
:EXEC
%*
GOTO:EOF
I call this using this format:
CALL :MakePath "<input text>" <output variable name>
E.g.:
CALL :MakePath %4 artistFolder
CALL :MakePath %5 albumFolder
If %4 is "AC/DC"[/font] %artistFolder% wil be AC DC[/font].
You could therefore rename a file, as per schnittlich's request, by doing:
CALL :MakePath %4 artistFilename
CALL :MakePath %5 albumFilename
REN "%~dp3%~n1.*" "%artistFilename%_%albumFilename%.*"
... ensuring that the MakePath "function" is at the foot of your batch file.
I have found [a href="http://www.ss64.com/nt/ren.html]this site[/url] to be invaluable while creating my batch files. That said, I am in no way an expert - these batch files are by far the most complex I have written - so please feel free to use this code, but don't take my methods as gospel!
[span style='font-size:8pt;line-height:100%']
Edit: updated MakePath function to reflect my current version at home[/span]