Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8491301
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T22:22:52+00:00 2026-06-10T22:22:52+00:00

Short version of the question here, I run an exceutable (which in turn runs

  • 0

Short version of the question here,

I run an exceutable (which in turn runs a simulation) from a batch file. I can run up to four of these at once. Is there any method for checking (from the batch file) how many of these executables are running at a time?

Long version,

I have a batch file which allows me to run multiple models but dues to licencing I cannot run more than 4 models simultaneously. I can however queue them up to be run, however i am struggling to write a batch file which ensures that there are always four models running at all times. My best effort (cobbled together from searching the internet) is below

            FOR %%a in (%A%) do (
                FOR %%b in (%B%) DO (
                    FOR %%c in (%C%) DO (
                         FOR %%d in (%D%) DO (
                            SET /A COUNT+=1
                            SET /A Result =!COUNT!%%4
                            :: set Result to the remainder of the Count divided by 4
                            if !Result! == 0 (
                                start "TUFLOW" /wait C:\Tuflow\TuflowExe\Build_2011_09_AF_64\TUFLOW_iSP_w64.exe -e1 %%a -s1 %%b -s2 %%c -s3 %%d C:\Tuflow\Model\Ohoka\runs\OH.tcf
                            ) else (
                                start "TUFLOW" C:\Tuflow\TuflowExe\Build_2011_09_AF_64\TUFLOW_iSP_w64.exe -e1 %%a -s1 %%b -s2 %%c -s3 %%d C:\Tuflow\Model\Ohoka\runs\OH.tcf
                            )
                         )
                    )
                )
            )

Where A, B, C and D are arrays containing variable combinations that are passed to the executable. I then have a count which records the iterations, on every fourth iteration the “True” condition for the if statement is triggered and the batch waits until the model run is completed before continuing.

This is ok, but my other three models may finish earlier, freeing up valuable cpu time that is not utilised because the batch is waiting for the fourth iteration to complete. Or worse, the fourth iteration completes prior to the other three and ends up trying to run more than four models which causes a licensing pop up which requires a user to dismiss.

Any suggestions or other solutions that I am bound to have missed?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T22:22:54+00:00Added an answer on June 10, 2026 at 10:22 pm

    It’s relatively easy to count the number of programs running by using tasklist.exe

    for /f "skip=3" %%x in ('tasklist /FI "IMAGENAME eq TUFLOW_iSP_w64.exe"') do set /a count=count+1
    echo TUFLOW_iSP_w64.exe is running %count% times.
    

    Just remember to clear count or set it to 0 each time you run it.

    Or, more slowly:

    for /f %%x in ('tasklist ^| find /c "TUFLOW_iSP_w64.exe"') set count=%%x
    Echo TUFLOW_iSP_w64.exe is running %count% times.
    

    The above code is slower because find has to process the entire tasklist.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

SHORT VERSION OF QUESTION: So basically my question is: How can I set the
The short version of the question - why can't I do this? I'm restricted
Here's a self-contained application you can run that illustrates my question. When using a
Short version question : Is there navigator.mozIsLocallyAvailable equivalent function that works on all browsers,
The short version of the question: I do: x = y . Then I
I have a short version of the question: I start a thread like that:
This is basically a rails 3 version of this question . Short of parsing
Short version: Can I grant access to external databases to a role? Long version:
So the short version of my question is, how are we supposed to encode
The short version of my question is: How do I access the phone numbers

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.