Wait for a .bat file to close within a windows batch file
<p>I need to create a windows batch file (*.bat) file that only runs its commands if certain processes (and batch files) are NOT running.</p>

<p>I have looked at a solution that works for processes (*.exe) here:
<a href="https://stackoverflow.com/questions/8177695/how-to-wait-for-a-process-to-terminate-to-execute-another-process-in-batch-file">How to wait for a process to terminate to execute another process in batch file</a></p>

<p>I want to do something very similar, however, there is one difficulty: Batch files show up as "cmd.exe" in the "TASKLIST" command.</p>

<p>I want to check if a specific bat file is running, for example: "C:\mybatch.bat", and if it is, wait until it is closed.</p>