tags:

views:

193

answers:

3

I wrote a batch file, which has 3 .bat file running in background. I have another batch file which has 3 .bat file, which is used to stop those .bat file which ran in first batch file. All this is working fine, but after stopping those .bat files, first batch file's command window is not closing. I gave 'exit' to both the batch file which I wrote. Please help me in this.

A: 

Are you using

call batchfile.bat

to run the batchfiles? If not, the flow will be unexpected.

schnaader
i am using start /b batchfile.bat
Even while testing with 4 simple batch files, this yields to strange errors. I think you shouldn't call batchfiles like this, it seems to confuse cmd.
schnaader
A: 

if you could convert it to .exe, with Bat-To-Exe-Converter, you could use:

tskill [program]

Like if you want to close a batch file which is converted called 'helloworld.exe':

tskill helloworld

What you also could use, is:

tskill cmd

And do this a few times. It will close 1 commdandprompt/time.

YourComputerHelpZ
A: 

You could try starting the other batch files with

CMD /C

alternatively when they are supposed to close, you could try closing them by name directly from the other batch file:

taskkill /F /IM batchname.bat
John T