Task Scheduler Result - 0x1

G

GSP@DavClaServ

I have set up a scheduled task to run on an WinXP home PC. The task simply
calls a batch file to move some files across our LAN to another PC. If I run
the batch file by dbl clking it works fine but the sceduled task returns a
code of 0x1 which according to the MS support pages means "An incorrect
function was called or an unknown function was called."
(http://support.microsoft.com/kb/308558).

When setting up the task I browsed to the batch file to select it so I know
the path and file name are correct .

How is it that something so simple can be so complicated? Can anyone shed
some light on this?

TIA
Steve
 
P

Pegasus \(MVP\)

GSP@DavClaServ said:
I have set up a scheduled task to run on an WinXP home PC. The task simply
calls a batch file to move some files across our LAN to another PC. If I
run the batch file by dbl clking it works fine but the sceduled task
returns a code of 0x1 which according to the MS support pages means "An
incorrect function was called or an unknown function was called."
(http://support.microsoft.com/kb/308558).

When setting up the task I browsed to the batch file to select it so I
know the path and file name are correct .

How is it that something so simple can be so complicated? Can anyone shed
some light on this?

TIA
Steve

It is not complicated at all when you think about it. A non-zero
exit code means that one of your batch file commands returned
a non-zero result code. Your task is to give yourself some eyes
so that you can see which command causes the problem, and
what the problem is. The standard way to do it goes like this:

@echo off
echo %date% %time% %UserName% >> c:\test.txt
xcopy . . . . . . 1>>c:\test.txt 2>>&1
echo %date% %time% End of job >> c:\test.txt

Now replace "xcopy" with whatever command(s) your own
batch file uses, then rerun the batch file under the Task Scheduler.
When done, examine c:\test.txt and all will become perfectly
clear. Chances are you have a permissions problem or a problem
with a drive letter that you thought existed but did not. Mapped
drive letters are session-specific - just because you can see them
when logged on does not mean they exist when the task runs
under its own account - they don't!
 
G

GSP@DavClaServ

Thanks for your reply. I suppose I should have said, "How is it that
something so conceptually simple can be so complicated?".

It was permissions related, sort of. The task function requires a password
to operate. The username I was logging in with did not have a password set.
As soon as I set up the user with a password evrything works as expected.

Thanks again.
 

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

Similar Threads


Top