Cannot start a program with parameters
batch-file, command-line
Solution
Adding quotation marks `""` should do the trick:
cmd /c "%dosbox% --userconf %conf%"
Problem
I am having problems running a program with parameters. My batch file looks like this: ``` @echo off set selfdir=%~dp0 set conf="%temp%\dosbox.%random%.conf" set dosbox="%selfdir%dosbox.exe" :: Other code cmd /c %dosbox% --userconf %conf% :: Other code ``` This fails with the error: ``` The filename, directory name, or volume label syntax is incorrect. ``` Substituting `cmd /c` with `start /wait` complains about a missing '--userconf', and putting nothing in its place causes the program to start without the arguments. EDIT: `%dosbox%` holds the location to the DOSBox executable. How can I correct this problem?