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?
Windows Server 2003

Avatar of undefined
Last Comment
technicaexpert

8/22/2022 - Mon
Bradley Fox

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?
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,

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.
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy
technicaexpert

ASKER
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
oBdA

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
MidnightOne

technicaexpert

ASKER
oBdA - That solved it. Thanks very much to everyone who helped!
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.