I'm trying to launch a specific ammount of the same batch file at the same time and I'm having trouble passing the parameters.
Here's the command I use:
START "Split lossless enc %%G" "%wrkdir%_menc.bat" "%wrkdir%%avs%_%%G.avs" "%wrkdir%%outf%_%%G.avi" "%menc%" "%mencx%"
%%G is a number(from 1 to 4 in my test)
%wrkdir% is the current working directory(so basically %~dp0)
%avs% and %outf% are both filename without extension
%menc% is a fullpath with filename and extension
%mencx% is a filename with extension
Any of those could potentially contain spaces but they don't in the test I've made so removing the surrounding quotes for the parameters works perfectly for now.
After all the searching I've done, everything tells me simply quoting the parameters should do the trick but I keep getting the following error: The filename, directory name, or volume label syntax is incorrect.
I've tried not using the parameters in the launched bat file to make sure it wasn't how I used it there that cause the problem(even though I very much doubted it), but it doesn't work even if it only contains ECHO it works
Edit: I forgot to say that the START is in a FOR loop that goes from 1 to 4 and that I use setlocal enableDelayedExpansion but all of the variable I use are set before it(except the %%G which obviously belongs to the FOR) and are outside of the loop
Edit2: To make it easier, I've stripped the batch file to the bare minimum(I tested it to make sure I got the same error) so I could give you the whole thing:
@ECHO off
SET wrkdir=%~dp0
SET avs=encode-01
SET menc=D:\_1enc_\_Tools\Mencoder\mencoder_r32198.exe
SET outf=test_mt
SET inst=4
SET mencx=%menc%
:FindMencx
IF NOT "%mencx:*\=%"=="%mencx%" (
SET "mencx=%mencx:*\=%"
GOTO FindMencx
)
FOR /L %%G IN (1,1,%inst%) DO (
START "Split lossless enc %%G" "%wrkdir%_menc.bat" "%wrkdir%%avs%_%%G.avs" "%wrkdir%%outf%_%%G.avi" "%menc%" "%mencx%"
)