0
I'm on Windows 7 Ultimate SP1 x64, running MP4Box - GPAC version 0.7.2-DEV-rev357-g7115eeb8-master.
I've created a BAT file like this :
mp4box -add %1#trackID=1:name= -add %2#trackID=1:name= -tmp "%~dp1\" -new "%~n1_new.mp4"
which works fine, but before adding \
to %~dp1\
it gave the error :
Error - 2 input names specified, please check usage
Why does it need 2 backslashes to work ?
If it's important I just drag&drop the video and audio on the BAT file.
BTW, is %1#trackID=1:name=
OK or I should change it to this "%~1#trackID=1:name="
?
Thank you so much for the explanation and the links, they were educational. I just wanted to know why it needed 2 backslashes at the end, so now if I understand this correctly the last backslash is being escaped (") so I need to add another backslash. What about the second question ? Do you know which one is better ? – Derp – 2018-07-05T16:46:20.870
@Derp I would suggest always using
%~1
and then ensuring to enclose the variable as needed with double quotes so it will handle spaces in the file names or folder path correctly. So if file nametest 123.txt
you will use"%~1"
so it is returned as"test 123.txt"
... you obviously need to understand the app parameters you are using and how this is interpreted and thus the"%~1#trackID=1:name="
example you showed would be best in my opinion. Using the tilde and enclosing in double quotes has never caused problems for me whereas not using and having spaces in the value has. – Pimp Juice IT – 2018-07-05T17:14:14.303