Microsoft abandoned the flexibility of the CMD command processor about 20 years ago with the advent of 4nt. However, another company took over the concept that made the product much better. It has gone through several buyouts and now is handled by:
https://jpsoft.com/
with TCC.exe. Some people may remember it as 4NT or 4DOS from years ago. They sell a registered version for development ($100) and have it as an installed free run time use for all the other computers. Well worth the trouble if you're software engineer.
Here is a batch line that starts a VideoPad project in a different thread, waits 5 seconds (90/18), and then brings up the export window and writes the file.
start NAME.VPJ & keystack /w90 ctrl-b enter
The next line waits for video pad to become idle for one second before continuing.
gosub :waitVideopad
The next line terminates VideoPad since the file was written.
keystack /W9 alt-F4 /w9 tab enter
Here is the meat of of the code to wait for VideoPad to become idle. This is important because VideoPad flushes the keyboard buffer when it becomes idle. So all keyboard stuffing must be done after VideoPad has becomes idle. This routine makes sure that VideoPad will be idle before returning and makes it the active process for keyboard stuffing.
:waitVideopad
set pidnum=%@pid[videopad*]%
set firstt=%@processtime[%pidnum%,3]%
delay 1
set newt=%@processtime[%pidnum%,3]%
if %newt% gt %firstt% goto :waitVideopad
activate "videoPad*"
return