I'm trying to get process id of executable that needs series of commands redirected from file, adapted from this answer:
for /f "tokens=2 delims==; " %%A in (
'wmic process call create "'%exe%' ^< '%arg1%'" ^| find "ProcessId"'
) do set "PID=%%A"
echo "%PID%"
where %arg1% is path to .txt file containing commands needed for automation of simulations for some naval architecture software.
The goal of this is to run 2 sets of commands in parallel so each instance of .bat script must kill it's own process(for some other reasons task kill is necessary).
Error occurs somewhere here:
wmic process call create "'%exe%' ^< '%arg1%'
so the question is, is it possible and how to redirect commands from file in wmic.