New
#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?
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?
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--
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?
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.
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
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!
It would be better to state which AV's (name them) and state if they are installed or portable.
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)