Link to home
Create AccountLog in
Avatar of technicaexpert
technicaexpert

asked on

Server 2003 Task Scheduler returning exit code 0x4

I have scheduled a task to run a batch file to copy data from one server to another. The batch file runs great when manually started. Everytime I try to schedule or even right click the task and manually start it, nothing appears to happen. I check the log for the task scheduler and it says "The task completed with an exit code of (4)." Any thoughts?
Avatar of Bradley Fox
Bradley Fox
Flag of United States of America image

Did you setup the task to run as a specific user?
Does this user have access to run the batch file/access source and destination directories?
Avatar of dooleydog
dooleydog

when it says the task completed, does that mean it ran or errored?

Is this a *.bat file? does it need a password in the middle of the batch run?

can you schedule it to copy from, instead of copy to?

if you are copying from one server to another, you will of course need to have NTFS permissions on each server where you are copying to.

Good Luck,

Avatar of technicaexpert

ASKER

The task is set to run as the administrator. This machine is a DC if that makes any difference. The administrators group is set to have full access to the batch file as well as the source/destination folders.
Dooley- the task must have errored as nothing has been copied. Basically the batch file consists of 2 lines:

xcopy d:\*.* z: /e /c /y
xcopy e:\*.* z: /e /c /y

Where z: is the mapped share for the destination system, e: and d: are local drives on the system.
ASKER CERTIFIED SOLUTION
Avatar of oBdA
oBdA

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
oBdA - That solved it. Thanks very much to everyone who helped!