batch file multiple instances

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
stathis
Posts: 7
Joined: 23 Oct 2013 11:55

batch file multiple instances

#1 Post by stathis » 27 Apr 2015 10:46

Hey everyone. I need help with something.
I have a batch file batch.bat that runs after a torrent finishes performing some standardized routines.

Sometimes it happens, while batch file is still running, that another torrent finishes and batch.bat is triggered again, messing everything up. What is want it to check if batch.bat is still running, then wait to finish and continue with the new instance of batch.bat

Can we do something like this?

Thanks for the help!!

Compo
Posts: 599
Joined: 21 Mar 2014 08:50

Re: batch file multiple instances

#2 Post by Compo » 27 Apr 2015 11:02

Since you've provided little information regarding your OS, paths etc., the least you could do is paste your existing batch file (between code tags) into your message!

stathis
Posts: 7
Joined: 23 Oct 2013 11:55

Re: batch file multiple instances

#3 Post by stathis » 27 Apr 2015 11:15

Compo wrote:Since you've provided little information regarding your OS, paths etc., the least you could do is paste your existing batch file (between code tags) into your message!


Compo thanks for the reply. OS is Windows 8.1 and path is c:\batch.bat

I'm not at home now to post the code, but i don't think it matters what the batch actually does. I'm just wondering if it can wait until first instance finishes and then launch the second instance

ShadowThief
Expert
Posts: 1163
Joined: 06 Sep 2013 21:28
Location: Virginia, United States

Re: batch file multiple instances

#4 Post by ShadowThief » 27 Apr 2015 12:55

Are you using call or start to run your batch scripts? You should be using call.


Post Reply