Jump to content

Task Scheduler Result - 0x1


Recommended Posts

Guest GSP@DavClaServ
Posted

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

  • Replies 2
  • Created
  • Last Reply
Guest Pegasus \(MVP\)
Posted

Re: Task Scheduler Result - 0x1

 

 

"GSP@DavClaServ" <info@davclaserv.com> wrote in message

news:efb3$483ed172$d1a8fa82$20213@EDELTACOM.COM...

>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!

Guest GSP@DavClaServ
Posted

Re: Task Scheduler Result - 0x1

 

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.

 

"Pegasus (MVP)" <I.can@fly.com.oz> wrote in message

news:eOxMiYcwIHA.1980@TK2MSFTNGP02.phx.gbl...

>

> "GSP@DavClaServ" <info@davclaserv.com> wrote in message

> news:efb3$483ed172$d1a8fa82$20213@EDELTACOM.COM...

>>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!

>


×
×
  • Create New...