Error code 4 for Task Scheduler

G

Guest

I am getting an error code 4 upon a scheduled task trying to run. The task
is running an MS-DOS batch file with an XCOPY command in it to transfer some
files. The batch file runs fine when run manually, so I think it has
something to do with running after hours when not logged in. Does anyone
know exactly what this error code indicates? I don't want to pay $200 for
the MS Driver Dev Kit which supposedly explains these codes.
Thanks.
 
P

Pegasus \(MVP\)

ctdak said:
I am getting an error code 4 upon a scheduled task trying to run. The task
is running an MS-DOS batch file with an XCOPY command in it to transfer some
files. The batch file runs fine when run manually, so I think it has
something to do with running after hours when not logged in. Does anyone
know exactly what this error code indicates? I don't want to pay $200 for
the MS Driver Dev Kit which supposedly explains these codes.
Thanks.

Most task scheduler error codes are generated by the command
you're running, i.e. xcopy.exe in your case. Add some basic
diagnostics and you'll soon see what's going on:

xcopy /s /y /.... "c:\SomeFolder\..." "d:\Other Folder\..."
1>c:\test.log 2>c:\test.err

What do the two log files tell you when you run the job?
 
D

Dave Patrick

net helpmsg 4
returns with
'The system cannot open the file.'

If it involves network resources, make sure the user account has permissions
to the resources and also use UNC paths as mapped drives won't 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

:
|I am getting an error code 4 upon a scheduled task trying to run. The task
| is running an MS-DOS batch file with an XCOPY command in it to transfer
some
| files. The batch file runs fine when run manually, so I think it has
| something to do with running after hours when not logged in. Does anyone
| know exactly what this error code indicates? I don't want to pay $200 for
| the MS Driver Dev Kit which supposedly explains these codes.
| Thanks.
|
 
G

Guest

Yes, my XCOPY command did refer to a mapped drive. I forgot that would be a
problem when logged off. Thanks for the tip. The UNC path should make it
work.
ctdak
 
G

Guest

I can't seem to get the diagnostic lines to work, but I think my problem is
solved now anyway per the other posted response. Thanks for answering.
ctdak
 
D

Dave Patrick

You're welcome.

--
Regards,

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

:
| Yes, my XCOPY command did refer to a mapped drive. I forgot that would be
a
| problem when logged off. Thanks for the tip. The UNC path should make it
| work.
| ctdak
 

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