Search code examples
batch-filemarathontesting

Batch File not kicking off another batch file


I have created a batch(batA) file that kicks off another batch(marathon.bat) file. When I save batA onto my desktop and use

start /wait ..\marathon\marathon.bat -batch "C:\stuff"

it works just fine. However, when I save marathon.bat to my program files, which now has spaces in the name, and then use

start /wait c:\"Program Files (x86)\marathon\marathon.bat" -batch "c:\stuff"

I get the error:

'c:\Program' is not recognized as an internal or external command, operable program or batch file.

I know that you have to use double quotes so that it takes the spaces into consideration, but why is it stopping at c:\Program? I've tried moving the quotes around to different locations, but I can't seem to get it to recognize the second file.


Solution

  • Does this work for you?

     start "" /wait %comspec% /c "c:\Program Files (x86)\marathon\marathon.bat" -batch "c:\stuff"