How to run concurrent batch jobs in task scheduler

Discussion in 'Windows 10 Help and Support' started by James Anning, Oct 16, 2016.

  1. James Anning

    James Anning New Member

    Joined:
    Oct 16, 2016
    Messages:
    4
    Likes Received:
    0
    hi,

    This should be an easy answer. I want to create one scheduled task, it will be called "CLEAR_PHOTOSBYDATE", see attached pic or (approximate example, not literal job...yet)

    In this task I will have several batch jobs. I know how to set it up to run them consecutively, 1st one runs, the 2nd will not run till first completes. I want it to kick of the first batch job, then immediately kick off the 2nd, 3rd etc., I want to run them all at once in parallel.
    How is this done?
    Thanks James.
     

    Attached Files:

  2. BIGBEARJEDI

    BIGBEARJEDI Honorable Member
    Premium Supporter

    Joined:
    Jan 28, 2013
    Messages:
    1,778
    Likes Received:
    214
    @neemo: Is this possible? I didn't think the Task Scheduler was capable of parallel-processing multiple batch jobs.

    Hi James,
    I'm asking one of our crack programmers if this is even possible for you. If it is, he may have a script file or a power-shell file that you can use for it as well. My understanding is that in order to run in parallel, you'd have to have multiple computers hooked up to your hard drive to do so. The other possibility is that you could use the multiple desktops feature of W10 to have your batch file run each batch job from a different W10 desktop session. This might also work if you were using a VMware type of product or hyper-V to run the multiple batch jobs from different W10 VM sessions each spawned by the original script file. It is possible to run multiple VM sessions in W10 each running a different batch job, but how many you can run is dependent on the power of your CPU chip, and a function of the amount of RAM you have in your computer and the size of your hard drive. Multiple sessions each eat up considerable RAM (many GB). Hopefully, we'll hear back from neemo or one of the other fellas here who might have a more specific suggestion for you, a sample script file as I said, etc.

    Best,:D
    <<<BIGBEARJEDI>>>
     
  3. Neemobeer

    Neemobeer Windows Forum Team
    Staff Member

    Joined:
    Jul 4, 2015
    Messages:
    2,382
    Likes Received:
    360
    Why not make it all one batch file then or have the first batch file start the second and wait for it to complete then start the third.
     
  4. Neemobeer

    Neemobeer Windows Forum Team
    Staff Member

    Joined:
    Jul 4, 2015
    Messages:
    2,382
    Likes Received:
    360
    At best you would need to have the have the first batch file create an entry in the event log and have the second batch file fire off on an Event Trigger, and create a second event that triggers the third batch file.
     
  5. Neemobeer

    Neemobeer Windows Forum Team
    Staff Member

    Joined:
    Jul 4, 2015
    Messages:
    2,382
    Likes Received:
    360
    You may also want to create a powershell script install of a batch file, you will have a lot more control and the script will be much easier to write. If you have more information about the process and from where you are cleaning up data from I'd be happy to help you write a powershell script.
     
  6. BIGBEARJEDI

    BIGBEARJEDI Honorable Member
    Premium Supporter

    Joined:
    Jan 28, 2013
    Messages:
    1,778
    Likes Received:
    214
    My thinking too; though my script programming skills are quite rusty. Thanks for the assist here, neemo!!;)

    Cheers!
    BBJ
     
  7. James Anning

    James Anning New Member

    Joined:
    Oct 16, 2016
    Messages:
    4
    Likes Received:
    0
    I just separated the huge .bat file I had, into 8 logically grouped .bat files, then used one bat file containing the below. It kicks them all 8 off, at once and finishes all I need done in 20 minutes instead of the 4 hours it did take before. What I was looking for, was to put the 8 bat files in the scheduler and have it spawn all 8, ....instead of the below doing it. Works like a champ, I'd still like to hear other possibilities.


    START CLEAR_PHOTOSBYDATE0.BAT
    START CLEAR_PHOTOSBYDATE1.BAT
    START CLEAR_PHOTOSBYDATE2.BAT
    START CLEAR_PHOTOSBYDATE3.BAT
    START CLEAR_PHOTOSBYDATE4.BAT
    START CLEAR_PHOTOSBYDATE5.BAT
    START CLEAR_PHOTOSBYDATE6.BAT
    START CLEAR_PHOTOSBYDATE7.BAT
     
  8. Neemobeer

    Neemobeer Windows Forum Team
    Staff Member

    Joined:
    Jul 4, 2015
    Messages:
    2,382
    Likes Received:
    360
    That works as well.
     
  9. James Anning

    James Anning New Member

    Joined:
    Oct 16, 2016
    Messages:
    4
    Likes Received:
    0
    It does, I have to say...I'm a bit confused and overwhelmed with the "multiple computers hooked up to your hard drive to do so. The other possibility is that you could use the multiple desktops feature of W10 to have your batch file run each batch job from a different W10 desktop session. "......Now, I've only been a database apps developer for 25 years...so I have not seen it all...but, this one baffles me?
     

Share This Page

Loading...