I am trying to call 18 .bat files from one single .bat file

February 6, 2013 at 10:35:08
Specs: Windows XP
I have tried to use the "call" command e.g. the below example is all that there is in the file call.bat file:

call c:\unxs2510_7551.bat
call c:\unxs2510_7552.bat

When I run the call.bat file a dos window flashes on off screen and nothing happens. I have tested that the batch file I am calling works ok when I run it by itself. The call.bat does work if I call just one of the .bat files e.g. c:\unxs2510_7551.bat. But as soon as I add the other file c:\unxs2510_7552.bat to call i just get a dos window flash on off screen and nothing happens. Its as though it cannot run it. I have tried adding a pause but nothing helps.

Thanks in advance to anyone kind enough to try and help...

See More: I am trying to call 18 .bat files from one single .bat file

Report •

February 6, 2013 at 13:40:10
as long as the one batch is running from a call statement, it will not return to the origional untill the last called batch closes...

you might try using

CMD /c c:\unxs2510_7551.bat
start c:\unxs2510_7551.bat

and so on

I am thinking that the batch previous to the one that you are unable to run is the culprit. I would advise seeing if it is hanging open for a reason. If it was intentional you may want to rethink how its set up.

:: mike

Report •

February 6, 2013 at 20:11:08
Also, never use a system command for your batch-name. I doubt that this is the issue here, but it is really bad to do this. Rename your (primary) batch to "call0.bat" or something. CALL is a system command.
If the cmd-window is flashing off, you can try logging: put some kind of echo-msg into the code (and called-codes), piped to a log file, f/e:
echo point 'a' %* %time% >> c:\test
then examine the log. Synchronous vs asnychronous can have a major effect on how "chained" or serial calls interact. (see: start /? esp: start /w)

Report •
Related Solutions

Ask Question