How to Program Task Scheduler to Run 3 Programs One After the Other?

Page 1 of 2 12 LastLast
  1. yahanna's Avatar
    Posts : 505
    10
       #1

    How to Program Task Scheduler to Run 3 Programs One After the Other?


    Hi guys.. I'm trying to program Task Scheduler to run 3 antivirus programs one after the other. How do I program it to do so?
      My Computer

  2. EdTittel's Avatar
    Posts : 4,165
    Windows 10
       #2

    Here's a good and accurate discussion of this topic from SuperUser: Scheduling Sequential Tasks in Windows Scheduler - Super User. I agree with the respondent in that thread that you may be better served using a PowerShell script to set up and coordinate running your three programs, and then simply schedule that script to run.
    HTH,
    --Ed--
      My Computers

  3. dalchina's Avatar
    Posts : 31,807
    Win 10 Pro (1903)
       #3

    Run 3 AVs? Do you mean...
    Launch and run a scan to completion with AV1
    Launch and run a scan to completion with AV2
    Launch and run a scan to completion with AV3?

    If so that's non-trivial.

    And why would you have 3 AV's installed?
      My Computers

  4. yahanna's Avatar
    Posts : 505
    10
    Thread Starter
       #4

    EdTittel said:
    Here's a good and accurate discussion of this topic from SuperUser: Scheduling Sequential Tasks in Windows Scheduler - Super User. I agree with the respondent in that thread that you may be better served using a PowerShell script to set up and coordinate running your three programs, and then simply schedule that script to run.
    -
    Appreciate the link but I still dont know how to set that up in task scheduler .


    dalchina said:
    Run 3 AVs? Do you mean...
    Launch and run a scan to completion with AV1
    Launch and run a scan to completion with AV2
    Launch and run a scan to completion with AV3?
    And why would you have 3 AV's installed?
    Yes thats the correct set of steps I want. How do I do that?

    I have 3 types of AVs. Theyre not the same doing the same tasks.
      My Computer

  5. dalchina's Avatar
    Posts : 31,807
    Win 10 Pro (1903)
       #5

    Assuming each takes a significant and unpredictable time to run, and that you know what parameters to give to each program to instruct it what to scan, then you could use the task scheduler to launch a script written to
    a. launch an AV
    b. test for completion of a scan (you'd have to work out how to do that - Autohotkey is good at manipulating processes and windows - free).
    c. When complete, launch the next similarly..then the last

    That's simply using the task scheduler to launch one program. That, if feasible, would ensure the minimum run time to completion.

    A simple case would be if each AV has an identifiable process that runs until the scan is complete, then closes. Autohotkey can easily test for the presence of that process in a loop- and when not present, exit the loop and so launch the next AV scan.

    OR - simpler:
    If you know the max time each will take, then simply have 3 task scheduler tasks timed to run in succession, one for each AV, with sufficient delay to ensure the previous one has finished.
      My Computers

  6. mngerhold's Avatar
    Posts : 717
    W10-2009 19042.928
       #6

    Why wouldn't putting the commands to run in a batch file work? AIUI (and just tested), a batch file waits for a program to finish before executing the next line. So you just need:
    prog1.exe
    prog2.exe
    prog3.exe etc

    Of course, you will need to quote the full path each time. Then just set that batch file to run as a scheduled task - I'll leave that for somone else to explain, but will cover it if I have to - its fairly simple. Is that any use? Martin
      My Computer

  7. yahanna's Avatar
    Posts : 505
    10
    Thread Starter
       #7

    mngerhold said:
    Why wouldn't putting the commands to run in a batch file work? AIUI (and just tested), a batch file waits for a program to finish before executing the next line. So you just need:
    prog1.exe
    prog2.exe
    prog3.exe etc
    Of course, you will need to quote the full path each time. Then just set that batch file to run as a scheduled task - I'll leave that for somone else to explain, but will cover it if I have to - its fairly simple. Is that any use? Martin
    And how do I do that?

    dalchina said:
    Assuming each takes a significant and unpredictable time to run, and that you know what parameters to give to each program to instruct it what to scan, then you could use the task scheduler to launch a script written to
    a. launch an AV
    b. test for completion of a scan (you'd have to work out how to do that - Autohotkey is good at manipulating processes and windows - free).
    c. When complete, launch the next similarly..then the last
    So again how do I program the 3 programs to start after each one finishes?
      My Computer

  8. dalchina's Avatar
    Posts : 31,807
    Win 10 Pro (1903)
       #8

    Thank you so much for your reply.


    a. Work out how to launch each AV to do what you want using the command line. You will have to research that- for each program - and whether it's possible.

    b. Termination- either you're really lucky and it just works as mngerhold suggests, or you need to do a test- which may or may not be possible, depending on how each program behaves when it finishes the scan.

    Good luck!
      My Computers

  9. Callender's Avatar
    Posts : 4,408
    21H1 64 Bit Home
       #9

    It would be better to state which AV's (name them) and state if they are installed or portable.
      My Computer

  10. mngerhold's Avatar
    Posts : 717
    W10-2009 19042.928
       #10

    yahanna said:
    And how do I do that? ... So again how do I program the 3 programs to start after each one finishes?
    Exactly as I wrote it above: to run a program in a batch file, simply enter the full name of the program(s) in sequence, if necessary include the full path to the program, eg to run explorer, followed by regedit:
    C:\Windows\explorer.exe
    C:\Windows\regedit.exe

    Regedit won't start until you close the explorer window opened up by the first line. You know, one way of learning how to do things is to try them out - we didn't all get instruction from some magic oracle. If the 'that' is creation of a scheduled task, then say so. If 'that'is how to create a batch file, then the answer is to use a plain text editor to create the above lines, then save as 'test.bat', then double-click on it or rt-click and select 'open' (I know, that is not intuitive)
      My Computer


 
Page 1 of 2 12 LastLast

  Related Discussions
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 01:16.
Find Us




Windows 10 Forums