Running one task after ONE FINISHES in windows task scheduler...

netrate

New member
Member
VIP
Local time
9:40 AM
Messages
174
I have used windows task schedule to set up small tasks such as opening a website or displaying a jpg. But what I really need to do is this :

Set up the task scheduler so that once a certain task is FINISHED, the next task automatically runs.
I have a short video clip of a fire (called movie) that will run with VLC - once that is complete, I want to run a powerpoint presentation immediately after the movie. Right now I have been trying with the custom filers, but can't seem to get it to work. Here is some of the code I was trying, but doesn't seem to work :

So to recap :

1) movie first (fireplace clip)
2) power point second (called after fire)

<QueryList>
<Query Id="0" Path="Microsoft-Windows-TaskScheduler/Operational">
<Select Path="Microsoft-Windows-TaskScheduler/Operational">*[EventData
[@Name='TaskSuccessEvent'][Data[@Name='after fire']='\movie']]</Select>
</Query>
</QueryList>

Any ideas? also, I have swapped the "After fire" and "movie" around and it still does not work. I wondered if since VLC doesn't shut down automatically if that is hindering it from running powerpoint.
 

My Computer My Computer

At a glance

Win 7 dual boot with win 1016gigGTX
Computer type
PC/Desktop
OS
Win 7 dual boot with win 10
Motherboard
Gigabyte GA-970A-d3
Memory
16gig
Graphics Card(s)
GTX
Monitor(s) Displays
3
Hard Drives
500 gig ssd Samsung
The usual way of running one task after another is to use a batch file to call each task to begin, in a sequence. Problem here with that, is you want to run the second task only after the first task has become INACTIVE, rather than when it become TERMINATED. Solution then might revolve around using a TIMEOUT in the batch file, since you know the movie is of fixed length. Just set the TIMEOUT to the lenght of the movie.
Batch file would look something like:
START TASK1
TIMEOUT seconds
TASKKILL /F /IM TASK1
START TASK2


If you particulalry want to use Task Scheduler, then I think you would need define both tasks as scheduled tasks and then, with a batch file, execute each scheduled taks with SCHTASKS /run command. ie
SCHTASKS /run /tn TASK1
TIMEOUT seconds
TASKKILL /F /IM TASK1
SCHTASKS /run /tn TASK2


Does eithre suggestion get you near a working solution?
 

My Computer My Computer

At a glance

Windows 7 x64, Vista x64, 8.1 smartphoneIntel E8400 65W 64-bitDDR2 2 x 2GB, 1GB x 2XFX Radeon HD5750
Computer type
PC/Desktop
OS
Windows 7 x64, Vista x64, 8.1 smartphone
CPU
Intel E8400 65W 64-bit
Motherboard
Gigabyte EP45-UD3LR
Memory
DDR2 2 x 2GB, 1GB x 2
Graphics Card(s)
XFX Radeon HD5750
Sound Card
AMD High Definition Audio; Realtek High Definition Audio
Monitor(s) Displays
iiyama prolite X2377HDS
Screen Resolution
1920 x 1080
Hard Drives
500GB 7200 rpm Seagate ST3500413AS 16MB, 500GB 5400 rpm Toshiba MQ02ABF050H 32MB, 200GB 7200 rpm Seagate ST3200820AS 8MB, 2TB 7200 rpm Western Digital WD20EZRX 64MB
PSU
Enermax Liberty Modular
Case
Antec P193 Midi Tower
Keyboard
Mionix ZIBAL 60
Mouse
Razer USB 2.0 Diamondback Mouse or Huion Graphics Tablet
Browser
Internet Explorer, Lunascape, Firefox, Opera, Avast Safezone
Is this strictly using a batch file use and not the task scheduler?

START TASK1
TIMEOUT seconds
TASKKILL /F /IM TASK1
START TASK2

Here is what I am trying :

echo.
echo Waiting
echo.

START "" "g:\irfanviewPortable\IrfanViewPortable.exe" "g:\irfanviewPortable\pic1.jpg" /fs

TIMEOUT /T 5

START "" "g:\irfanviewPortable\movie.mp4"
TIMEOUT /T 7

START "" "g:\irfanviewPortable\IrfanViewPortable.exe" "g:\irfanviewPortable\pic2.jpg" /fs
TIMEOUT /T 5

START "" "C:\Program Files (x86)\Mozilla Firefox\firefox.exe" "http://www.weather.ca"

pause >nul


This works, but not exactly as planned.

ISSUES:
1) The pic1 doesn't come up immediately, so I am left with only about 3 second that the image can be seen. This might be because it takes some time to run the program (irfanview). In that case, I can always tag more time on the initial TIMEOUT to compensate.

2) I want to close irfanview (and all of the other programs) when complete because I am going to be opening other instances of irfanview after the movie and don't want multiple instances of irfanview running. I need some help using TASKKILL.

3) The move is 6 seconds, so I am not sure what the timer is exactly doing here because it ends early with it, so I have added an additional second to it to make it work.

4) I want the webpage to open up full screen but firefox doesn't seem to allow that...not sure if there is a work around or not.

5) Lastly, I am going to code a python script to populate this batch file, hopefully it will be uneventful...
 

My Computer My Computer

At a glance

Win 7 dual boot with win 1016gigGTX
Computer type
PC/Desktop
OS
Win 7 dual boot with win 10
Motherboard
Gigabyte GA-970A-d3
Memory
16gig
Graphics Card(s)
GTX
Monitor(s) Displays
3
Hard Drives
500 gig ssd Samsung
Back
Top