I'm wondering if it's possible to make a batch script detect if and how many of a process instances are already running, and if too many are already running, make the upcoming instances of the process timeout and try again with time intervals untill few enough of the instances are running to let the next one run.
So for instance, i want to run 3 identical batch scripts, which each runs a process which takes about 10 minutes.
First starts, and starts the process.
About 1 minute later the second batch script starts, and starts another instance of the process.
Another 1 minute later, the third instance starts, but what i want it to do is check if there aren't already 2 instances of the process currently going, and if there are, i want it to timeout for a few minutes and then loop back and try again, again and again, untill one of the first 2 processes finishes, and the third batch script can run it's process and then finish up.
So something like
:process-check
if process.exe >2 already running{
do timeout 90 (seconds)
goto:process-check
}
if process.exe <2 already running {
goto:run-process
}
I hope i made what i want understandable.
I appreciate any help
