tags:

views:

246

answers:

2

I am trying to use a for statement in a Windows batch file ("File A") to call another program ("File B") for each .pdv (Procoder DV, not part of the problem) file in a particular directory. I want File A to wait until File B has finished running on the first .pdv file before it asks File B to run on the next .pdv file, but instead, all the calls to File B are happening at once. Here's File A:.

for %%X in (*.pdv) do (start /wait /b "My title" "File B" %%X)

Is there a way to get the calls to File B to happen sequentially (and if so, what is it)?

+2  A: 

You need to call the program that process .pdv files instead of calling start e.g.

for %%X in (*.pdv) do (pdv_processor.exe "%%X")
Shay Erlichmen
Thank you! I thought I had tried it that way first, but clearly I hadn't... everything's working great now.
Louisa Grey
A: 

In addition to this you are able to wait a certain time by calling the ping command. Wait 5 seconds:

ping 127.0.0.1 -n 5>nul
zoidbeck