I have a batch script that generates another batch (%outp%)
First I was doing like this:
Code: Select all
echo :aac>>"%outp%"
echo "%wavi_path%" "%%avs_file%%" - ^|"%neroAAC_path%" -ignorelength -q %%aac_quality%% -if - -of "%%audio_file%%">>"%outp%"
echo if %%errorlevel%%==0 (set audio_status=ok) else (set audio_status=erreur avec le aac)>>"%outp%"
echo goto video>>"%outp%"
echo.>>"%outp%"
Then I realized it can save space doing like this
I just had to escape ( and )
Code: Select all
(
echo :aac
echo "%wavi_path%" "%%avs_file%%" - ^|"%neroAAC_path%" -ignorelength -q %%aac_quality%% -if - -of "%%audio_file%%"
echo if %%errorlevel%%==0 ^(set audio_status=ok^) else ^(set audio_status=erreur avec le aac^)
echo goto video
echo.
)>>"%outp%"
But some of the variables can contain ( or ) and I didn't pay attention before.
So I have to make a chars substitution with every variables and I don't like this solution.
Is there a way do echo multiple lines easily with file redirection?
Thanks