I have a batch script that eventually starts another batch file and waits for it to complete. Here is the syntax I originally had:
for %%i in ("*.xml") do start /separate /wait "%PROGRAM_PATH%" "%LOCAL_OUTGOING_PATH%\%%i"
What happened is that instead of opening the program that %PROGRAM_PATH% points to, it ended up launching Internet Explorer and showing the XML file specified by %%i. It was like as though it ignored the %PROGRAM_PATH% portion of the start command. I tried using %PROGRAM_NAME% without quotes that didn’t work either. %PROGRAM_PATH%, by the way, points to ”
“C:\DOS\copy.bat”. So I ended up having to hard code the path in there like this:
for %%i in ("*.xml") do start /separate /wait C:\DOS\copy.bat "%LOCAL_OUTGOING_PATH%\%%i"
This made it finally work the way I wanted it to. But I want to be able to use a variable. Why doesn’t that work?
The first START parameter enclosed in quotes is taken as the Window Title. If you want to give a parameter enclosed in quotes you MUST first provide a title, even an empty one:
or
Type START /? for further details.