Windows 7 Forums
Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.


Windows 7: Running one task after ONE FINISHES in windows task scheduler...

29 Dec 2018   #1
netrate

Win 7 dual boot with XP
 
 
Running one task after ONE FINISHES in windows task scheduler...

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 System SpecsSystem Spec
.
29 Dec 2018   #2
iko22

Windows 7 x64, Vista x64, 8.1 smartphone
 
 

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 System SpecsSystem Spec
30 Dec 2018   #3
netrate

Win 7 dual boot with XP
 
 

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 System SpecsSystem Spec
.

Reply

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




Thread Tools




Similar help and support threads
Thread Forum
task in task scheduler test running never completes?
I created a batch file. it works fine, opens command prompt runs the task, then it exits. I set the task up in task scheduler. There is a run button, when run it goes from ready to running and never stops... I can select end. The task simply takes 7 seconds when I run it as clicking on the batch...
General Discussion
Prevent a task in Task Scheduler from running
Hello to everyone, I'm getting so so frustrated by Yandex Browser (I'm too lazy right now to replace it with another browser) since it creates an update task without my consent. I tried everything, Yandex settings, deleteting the task, deleting the update.exe file, rinominating the update...
Performance & Maintenance
How do I get Task Scheduler to stop running a deleted Task
I've been searching for days trying to find how to fix this issue. It came about when a hard disk crashed without warning and I didn't have a current backup. My bad, but fortunately it wasn't the system disk so I've been able to recover from the disk just dying. During the recovery phase, I...
General Discussion
Task Scheduler: running skipped task when it shouldn't?
I have a secondary computer in the network, which is supposed to stay in sleep mode most of the time. I always wake it up when necessary and put it back to sleep when it is no longer needed. I don't want it to fall asleep by itself during the day, so I set the sleep time to "Never" in Power...
General Discussion
task scheduler not running missed task
When i set task scheduler to run a program it works. But if the pc is not on at the time it will not run unless task scheduler is opened. It is set to run as soon as poss after scheduled time and task scheduler itself starts and runs properly
General Discussion


Our Sites

Site Links

About Us

Find Us

Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd

All times are GMT -5. The time now is 19:48.
Twitter Facebook