Scheduled Tasks Problem

C

Craig Matchan

Hi everyone,

we have a problem with a scheduled task not running. Basically we have three
tasks defined, all use the same username to run under, in this case the
domain administrator account. The two tasks that run ok run from the servers
local hard disk and write back to the local hard disk. The one task that is
failing to run via a schedule (it will run if you manually start it) runs
from one of the shares and writes to the other share.

This is what is logged in the scheduled tasks logfile

Unable to start task.
The specific error is:
0x80070005: Access is denied.
Try using the Task page Browse button to locate the application.

I did a search on the MS knowledge base on this and came accross a KB
article about making sure the account it is running under has "Access this
computer from the network". I've done this but it has not helped.

I thought it might also be related to the two shares it relies upon timing
out, the drives appear as "disconnected" after 30min or so. When run
manually the shares become "active", I assume they change state when they
are accessed, however I thought it might be casing the initial execution of
the program to fail when it's run via scheduled tasks. Once again I located
a MS KB article about extending the default share timeout values and have
increased it to it's max. Once again this has had no effect and the
application still fails to start when done via scheduled tasks. Both servers
are part of our domain, that is the server it is running from and the server
the shares are on. Both servers are Windows2003 Std Edition with SP1.

Any help welcome.

Regards

Craig
 
D

Dave Patrick

This article may help.

http://support.microsoft.com/?kbid=883279

Scheduled Tasks|Advanced|View Log may provide some details. If the job
connects to another machine you may need to add the user/ group 'logon as
batch job' rights (server side). Control Panel|Admin Tools|Local Security
Policy\Local Policies\User Rights Assignments
"Log on as a batch job"

If the task completes but the job does not then there is a problem in the
job itself. Remember that if it involves network resources to make sure the
user account has permissions to the resources and also use UNC paths as
mapped drives won't natively exist when no one is logged on.

--

Regards,

Dave Patrick ....Please no email replies - reply in newsgroup.
Microsoft Certified Professional
Microsoft MVP [Windows]
http://www.microsoft.com/protect

:
| Hi everyone,
|
| we have a problem with a scheduled task not running. Basically we have
three
| tasks defined, all use the same username to run under, in this case the
| domain administrator account. The two tasks that run ok run from the
servers
| local hard disk and write back to the local hard disk. The one task that
is
| failing to run via a schedule (it will run if you manually start it) runs
| from one of the shares and writes to the other share.
|
| This is what is logged in the scheduled tasks logfile
|
| Unable to start task.
| The specific error is:
| 0x80070005: Access is denied.
| Try using the Task page Browse button to locate the application.
|
| I did a search on the MS knowledge base on this and came accross a KB
| article about making sure the account it is running under has "Access this
| computer from the network". I've done this but it has not helped.
|
| I thought it might also be related to the two shares it relies upon timing
| out, the drives appear as "disconnected" after 30min or so. When run
| manually the shares become "active", I assume they change state when they
| are accessed, however I thought it might be casing the initial execution
of
| the program to fail when it's run via scheduled tasks. Once again I
located
| a MS KB article about extending the default share timeout values and have
| increased it to it's max. Once again this has had no effect and the
| application still fails to start when done via scheduled tasks. Both
servers
| are part of our domain, that is the server it is running from and the
server
| the shares are on. Both servers are Windows2003 Std Edition with SP1.
|
| Any help welcome.
|
| Regards
|
| Craig
|
|
 
P

Pegasus \(MVP\)

Craig Matchan said:
Hi everyone,

we have a problem with a scheduled task not running. Basically we have three
tasks defined, all use the same username to run under, in this case the
domain administrator account. The two tasks that run ok run from the servers
local hard disk and write back to the local hard disk. The one task that is
failing to run via a schedule (it will run if you manually start it) runs
from one of the shares and writes to the other share.

This is what is logged in the scheduled tasks logfile

Unable to start task.
The specific error is:
0x80070005: Access is denied.
Try using the Task page Browse button to locate the application.

I did a search on the MS knowledge base on this and came accross a KB
article about making sure the account it is running under has "Access this
computer from the network". I've done this but it has not helped.

I thought it might also be related to the two shares it relies upon timing
out, the drives appear as "disconnected" after 30min or so. When run
manually the shares become "active", I assume they change state when they
are accessed, however I thought it might be casing the initial execution of
the program to fail when it's run via scheduled tasks. Once again I located
a MS KB article about extending the default share timeout values and have
increased it to it's max. Once again this has had no effect and the
application still fails to start when done via scheduled tasks. Both servers
are part of our domain, that is the server it is running from and the server
the shares are on. Both servers are Windows2003 Std Edition with SP1.

Any help welcome.

Regards

Craig

This is usually caused by the account used to run the task having
insufficient access rights to the various resources. You can
easily find out. Embed your command in the following batch
file, then run it first from the Command Prompt and later via
the Task Scheduler. The log file will tell you what's going on.

@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>>&1
echo ErrorLevel of c:\Tools\YourTask.exe=%ErrorLevel% >> c:\test.log
echo %date% %time% End of task >> c:\test.log
 
C

Craig Matchan

Hi,

thanks for the replies. I've managed to get it running by having scheduled
taks call a local batch script instead of directly executing the .exe,
although, all the script does is run the executable, so in the end it is
effectively doing the same. Why it works when executed via a batch script
via scheduled tasks as apposed to running the .exe from the scheduled tasks
command line I do not know. Remember, it also ran ok if I select the Run
option when selecting the task, so it only failed when it was initiated by
the scheduler process. When I have some more time up my sleeve I will try
and investigate it more.

Thanks for the suggestions everyone.

Craig
 
D

Dave Patrick

Glad to hear you got something going.

--

Regards,

Dave Patrick ....Please no email replies - reply in newsgroup.
Microsoft Certified Professional
Microsoft MVP [Windows]
http://www.microsoft.com/protect

:
| Hi,
|
| thanks for the replies. I've managed to get it running by having scheduled
| taks call a local batch script instead of directly executing the .exe,
| although, all the script does is run the executable, so in the end it is
| effectively doing the same. Why it works when executed via a batch script
| via scheduled tasks as apposed to running the .exe from the scheduled
tasks
| command line I do not know. Remember, it also ran ok if I select the Run
| option when selecting the task, so it only failed when it was initiated by
| the scheduler process. When I have some more time up my sleeve I will try
| and investigate it more.
|
| Thanks for the suggestions everyone.
|
| Craig
 

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