Re: Task Scheduler Fails, But Not All the Time




Pegasus (MVP) wrote:
"Dennis Q. Wilson" <DennisQWilson@xxxxxxxxx> wrote in message
news:1145433226.319020.179060@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Pegasus (MVP) wrote:
"Dennis Q. Wilson" <DennisQWilson@xxxxxxxxx> wrote in message
news:1145428897.441914.251150@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Pegasus (MVP) wrote:
"Dennis Q. Wilson" <DennisQWilson@xxxxxxxxx> wrote in message
news:1145375512.313090.28040@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
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.

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.

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.


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.

.



Relevant Pages

  • Re: MS Scheduled Task
    ... I do get the following test.log after moving the bat file to my C ... echo %date% %time% Start of task> c:\test.log ... A test.log does not get created when I run it via the scheduler. ... Post your version of the batch file here. ...
    (microsoft.public.windowsxp.general)
  • Re: Task Scheduler Fails, But Not All the Time
    ... into the batch file below, ... echo %date% %time% Start of task> c:\test.log ... Now examine the two log files. ... In most Task Scheduler posts the ...
    (microsoft.public.windowsxp.general)
  • Re: errors running scheduled tasks
    ... Since you're invoking a batch file, ... my (temp/test) yourtask.exe file is c:\testx\test.bat ... @echo off ... if i open the task scheduler and watch it at the same time that it ...
    (microsoft.public.windows.server.general)
  • Re: Dayly backup fails to run after first day
    ... There's no need to run batch file. ... > examine the two log files each time. ... > Now invoke the batch file several times with the Task Scheduler, ...
    (microsoft.public.windows.server.general)
  • Re: Dayly backup fails to run after first day
    ... I urge you to embed it in a batch file like so: ... examine the two log files each time. ... Now invoke the batch file several times with the Task Scheduler, ...
    (microsoft.public.windows.server.general)