Task Scheduler Fails, But Not All the Time

D

Dennis Q. Wilson

I'm running a clean install of Windows XP Pro with Service Pack 2, and
I wish to use Task Scheduler to run a certain program at various times
each week (an ATI Multimedia Center video capture, for what it's
worth).

Most tasks complete just fine, but not all -- some never start. When I
check the "Scheduled Tasks" folder following such a failure, what I
invariably find is that the "Next Run Time" pertaining to the failed
tasks has mysteriously jumped many days ahead.

For example, if a program is scheduled to run every Wednesday at 8 p.m
beginning April 12, I might check it the next morning to find that, not
only did it not happen, but now the "Next Run Time" isn't set to April
19, but something like April 23, which is MORE than seven days ahead,
and isn't even a Wednesday!

To the best of my ability to double-check, the task properties have
been set correctly. And as I said, this only happens with SOME of the
scheduled video captures -- the rest execute as, well, scheduled.

Does anyone know what might be happening here?
 
P

Pegasus \(MVP\)

Dennis Q. Wilson said:
I'm running a clean install of Windows XP Pro with Service Pack 2, and
I wish to use Task Scheduler to run a certain program at various times
each week (an ATI Multimedia Center video capture, for what it's
worth).

Most tasks complete just fine, but not all -- some never start. When I
check the "Scheduled Tasks" folder following such a failure, what I
invariably find is that the "Next Run Time" pertaining to the failed
tasks has mysteriously jumped many days ahead.

For example, if a program is scheduled to run every Wednesday at 8 p.m
beginning April 12, I might check it the next morning to find that, not
only did it not happen, but now the "Next Run Time" isn't set to April
19, but something like April 23, which is MORE than seven days ahead,
and isn't even a Wednesday!

To the best of my ability to double-check, the task properties have
been set correctly. And as I said, this only happens with SOME of the
scheduled video captures -- the rest execute as, well, scheduled.

Does anyone know what might be happening here?

Before ***assuming*** that the task never starts, ***prove***
it beyond doubt that it does not, by embedding your command
into the batch file below, then scheduling that batch file:

@echo off
echo %date% %time% Start of task > c:\test.log
echo User=%UserName%, Path=%path% >> c:\test.log
c:\Tools\YourTask.exe 1>>c:\test.log 2>c:\test.err
echo ErrorLevel of c:\Tools\YourTask.exe=%ErrorLevel% >> c:\test.log
echo %date% %time% End of task >> c:\test.log

Now examine the two log files. I suspect they will show
that the task DID start but that it failed for some perfectly
good reason.
 
D

Dennis Q. Wilson

Pegasus said:
Before ***assuming*** that the task never starts, ***prove***
it beyond doubt that it does not, by embedding your command
into the batch file below, then scheduling that batch file:

@echo off
echo %date% %time% Start of task > c:\test.log
echo User=%UserName%, Path=%path% >> c:\test.log
c:\Tools\YourTask.exe 1>>c:\test.log 2>c:\test.err
echo ErrorLevel of c:\Tools\YourTask.exe=%ErrorLevel% >> c:\test.log
echo %date% %time% End of task >> c:\test.log

Now examine the two log files. I suspect they will show
that the task DID start but that it failed for some perfectly
good reason.

Do remember that I said, "Most tasks complete just fine, but not all --
some never start." That being the case, I created ***several*** of
those batch files and scheduled them to run at different times, because
just trying it once wouldn't ***prove*** much.

Five times the batch files executed properly; twice, not at all, and
with no log files produced. And again in the case of the two failed
trials, the Start Time mysteriously jumped nine days ahead.
 
P

Pegasus \(MVP\)

Dennis Q. Wilson said:
Do remember that I said, "Most tasks complete just fine, but not all --
some never start." That being the case, I created ***several*** of
those batch files and scheduled them to run at different times, because
just trying it once wouldn't ***prove*** much.

Five times the batch files executed properly; twice, not at all, and
with no log files produced. And again in the case of the two failed
trials, the Start Time mysteriously jumped nine days ahead.

I remember your words well but with the experience of a large
number of posts on the Task Scheduler I have learned to
question such remarks. In most Task Scheduler posts the
OP claims that some or all of the tasks fail to run when
in fact they do run but he looked in the wrong place.

I note that you reported in your first post that some tasks started
but never finished. You did not report this phenomenon for your
subsequent tests. This makes me wonder what has changed.

I'm also curious about the logs kept in the Task Scheduler's own
log files, and in the Windows Event logger. Did you check them?

Lastly I would run my proposed batch file with some stock standard
Windows command, e.g. attrib c:\*.* >> c:\test.log, in order to
eliminate any possible interference from a misbehaving third-party
application.
 
D

Dennis Q. Wilson

Pegasus said:
I remember your words well but with the experience of a large
number of posts on the Task Scheduler I have learned to
question such remarks. In most Task Scheduler posts the
OP claims that some or all of the tasks fail to run when
in fact they do run but he looked in the wrong place.

I note that you reported in your first post that some tasks started
but never finished. You did not report this phenomenon for your
subsequent tests. This makes me wonder what has changed.

Nothing changed. Where I wrote "Most tasks complete just fine, but not
all -- some never start," I meant that some not only don't complete,
they never start. In other words, my Scheduled Tasks have only two
results: successful completion and failure to launch.

But I also forgot to mention that when "Next Run Time" mysteriously
jumps forward, so does the Starting Time. The "Last Run Time" keeps
displaying "Never."
I'm also curious about the logs kept in the Task Scheduler's own
log files, and in the Windows Event logger. Did you check them?

Yeah, the logs bear me out. There's no mention of the tasks which fail
to launch.
Lastly I would run my proposed batch file with some stock standard
Windows command, e.g. attrib c:\*.* >> c:\test.log, in order to
eliminate any possible interference from a misbehaving third-party
application.

I anticipated you there when running the tests you suggested. Same
result: most run, but not all. I'm still totally mystified.
 
P

Pegasus \(MVP\)

Dennis Q. Wilson said:
Nothing changed. Where I wrote "Most tasks complete just fine, but not
all -- some never start," I meant that some not only don't complete,
they never start. In other words, my Scheduled Tasks have only two
results: successful completion and failure to launch.

But I also forgot to mention that when "Next Run Time" mysteriously
jumps forward, so does the Starting Time. The "Last Run Time" keeps
displaying "Never."


Yeah, the logs bear me out. There's no mention of the tasks which fail
to launch.


I anticipated you there when running the tests you suggested. Same
result: most run, but not all. I'm still totally mystified.

Have you considered the possibility that something may be
playing havoc with your system date/time? To prove/disprove
this I would start a Command Prompt and invoke the following
batch file. Keep it running while you repeat some of your other
test so that you capture one of the moments when you get
the jumping time phenomenon.

@echo off
:again
echo %date% %time% >> c:\loop.txt
ping localhost -n 300 > nul
goto again

I would also use the Task Scheduler to run this single-line
batch file once every 5 minutes, 24 hours a day:

@echo off
echo %date% %time% >> c:\ticker.txt
 
D

Dennis Q. Wilson

Pegasus said:
Have you considered the possibility that something may be
playing havoc with your system date/time? To prove/disprove
this I would start a Command Prompt and invoke the following
batch file. Keep it running while you repeat some of your other
test so that you capture one of the moments when you get
the jumping time phenomenon.

@echo off
:again
echo %date% %time% >> c:\loop.txt
ping localhost -n 300 > nul
goto again

I would also use the Task Scheduler to run this single-line
batch file once every 5 minutes, 24 hours a day:

@echo off
echo %date% %time% >> c:\ticker.txt

No, the possibility that something might be interfering with my system
date/time hadn't occurred to me, but it should have. Thanks for the
batch files. I'll be very interested to see the results.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top