I think you don't start the job with the service account but with the logged in useraccount... You have to fill in username and password

you can test this by giving your own account admin credentials... When the job starts this time it means you don't use the service account.

Still my opinion is to use the original UDF. Give it a try. I have used it a lot of times and never had problems with it...

Code:
Break On


$name='sync_scripts_dir'
$comp='comp1'
$date='TODAY'
$time='17:30'
$type='ONCE'
$cmd='\\comp1\Scripts\kix\sync_scripts_dir.exe'
;$prms=''
$user='admin'
$pw='adminpw'
;$comment='test'
;$typeargs=''
;$jt= 'c:\jt.exe'
scheduletask($name, $comp, $date, $time, $type, $cmd, $user, $pw)
? 'Error '+@ERROR+' - '+@SERROR

Exit


;FUNCTION ScheduleTask
;
;ACTION Schedules a task on any computer using the Task Scheduler
;
;AUTHOR Jens Meyer (sealeopard@usa.net)
;
;VERSION 1.41 (corrected typos in the date checker)
; 1.4 (added support for both MM/DD/YYY and YYYY/MM/DD date formats
; 1.3 (made username/password/comment optional parameters, changed parameter order, added
; optional parameter for JT.EXE location, checks %PATH% for presence of JT.EXE)
; 1.2 (removed error code trigger for deleting non-existing tasks, changed order of
; parameters that create task, updated header with regards to quote usage, added
; optional typearguments)
; 1.1 (added error codes, streamlined code)
; 1.0
;
;DATE CREATED 2001/12/04
;
;DATE MODIFIED 2004/01/06
;
;KIXTART 4.12+
;
;SYNTAX SCHEDULETASK($NAME,$COMP,$DATE,$TIME,$TYPE,$CMD [,$PRMS,$USER,$PW,$COMMENT,TYPEARGS,JT])
;
;PARAMETERS NAME
; name of the task
;
; COMP
; computername on which the task is to be run, computer must have the Task Scheduler installed
;
; DATE
; date on which to run the task (MM/DD/YYYY, YYYY/MM/DD, or TODAY)
;
; TIME
; time on which to run the task (H:M or NOW) with NOW indicating 60 seconds in the future
;
; TYPE
; trigger types (DAILY n | WEEKLY n, | MONTHLYDATE , | MONTHLYDOW n,,months |
; ONCE | ONIDLE | ATSTARTUP | ATLOGON)
;
; CMD
; the command to be executed by the task scheduler, cannot contain the quote character "
;
; USER
; userid under which to run the task (can be any valid local or domain user). If no userid
; is provided then the current userid is being used
;
; PW
; password for the userid
;
; PRMS
; optional parameters that are provided to the command, cannot contain the quote character "
;
; COMMENT
; comment field with information about task, cannot contain the quote character "
;
; TYPEARGS
; Optional parameter for trigger types, see jt /? ctj for details
;
; JT
; optional string denoting the location of JT.EXE, by default the UDF checks for JT.EXE
; in @STARTDIR, @SCRIPTDIR, @CURDIR, and %PATH%. @SCRIPTDIR will point to the location of the file
; containing the ScheduleTask UDF which does not necessarily need to be in the same directory
; as the actual script.
;
;RETURNS 0 if successful, otherwise error code
;
;REMARKS Requires the file JT.EXE, which is part of the Microsoft Windows 2000 Resource Kit Supplement
; and can be downloaded at ftp://ftp.microsoft.com/reskit/win2000/jt.zip
; Best used to schedule batch files due to problems with double quote usage in some of the JT.EXE parameters.
; Administrative privileges on the remote computer are required in order to schedule a task on the remote computer
; User environment variables like %USERNAME% or %LOGONSERVER% are not available in the scheduled tasks. System-wide
; environmentvariables like %COMSPEC% or %WINDIR% can be used, however.
;
;DEPENDENCIES 'Task Scheduler' service, can be installed via IE5.5 'Offline Browsing Pack' component under Windows NT 4.0
;
;EXAMPLE $name='demo.job'
; $comp='SERVER'
; $date='TODAY'
; $time='NOW'
; $type='ONCE'
; $cmd='notepad'
; $prms='%TEMP%\test.txt'
; $user='administrator'
; $pw='adminpassword'
; $comment='cool!'
; $typeargs=''
; $rc=scheduletask($name,$comp,$date,$time,$type,$cmd,$prms,$user,$pw,$comment,$typeargs,$jt)
;
;KIXTART BBS http://www.kixtart.org/ubbthreads/showflat.php?Cat=&Board=UBB12&Number=81907
;
function scheduletask($name, $comp, $date, $time, $type, $cmd, optional $prms, optional $user, optional $pw, optional $comment, optional $typeargs, optional $jt)
Dim $jtexe[3], $shellcmd, $path

if $name='' or $comp='' or $date='' or $time='' or $type='' or $cmd=''
exit 87
endif

; create an array of potential filepaths to jt.exe
$jtexe[0]=$jt
$jtexe[1]=@STARTDIR+'\jt.exe'
$jtexe[2]=@SCRIPTDIR+'\jt.exe'
$jtexe[3]=@CURDIR+'\jt.exe'
$path=split('%PATH%',';')
for each $jt in $path
redim preserve $jtexe[ubound($jtexe)+1]
$jtexe[ubound($jtexe)]=join(split($jt+'\jt.exe','\\'),'\')
next

; check each filepath for the presence of jt.exe
for each $jt in $jtexe
if exist($jt) and not (getfileattr($jt) & 16) and ubound($jtexe)+1
$jtexe=$jt
endif
next
select
case ubound($jtexe)+1
exit 2
case not exist($jtexe)
exit 2
endselect

if left($comp,2)<>'\\'
$comp='\\'+$comp
endif

if right($name,4)<>'.job'
$name=$name+'.job'
endif

select
case $date='TODAY'
; valid format
case len($date)<>10
exit 87
case substr($date,3,1)='/'
; valid format
case substr($date,5,1)='/'
; reformat date
$date=split($date,'/')
$date=$date[1]+'/'+$date[2]+'/'+$date[0]
case 1
exit 87
endselect

; delete a potentially existing task
$shellcmd = $jtexe
if $user and $pw
$shellcmd = $shellcmd+ ' /SC "'+$user+'" "'+$pw+'"'
endif
$shellcmd = $shellcmd+ ' /SM '+$comp
$shellcmd = $shellcmd+ ' /SD "'+$name+'"'

shell '%COMSPEC% /e:1024 /c '+$shellcmd+' >NUL 2>NUL'

$shellcmd = $jtexe

if $user and $pw
$shellcmd = $shellcmd+ ' /SC "'+$user+'" "'+$pw+'"'
endif

$shellcmd = $shellcmd+ ' /SM '+$comp
$shellcmd = $shellcmd+ ' /SJ ApplicationName="'+$cmd+'"'

if $prms
$shellcmd = $shellcmd+ ' Parameters="'+$prms+'"'
endif

$shellcmd = $shellcmd+ ' WorkingDirectory="%SYSTEMROOT%"'
$shellcmd = $shellcmd+ ' Comment="'+$comment+'"'
$shellcmd = $shellcmd+ ' Creator="'+@userid+'"'
$shellcmd = $shellcmd+ ' Priority=Normal'
$shellcmd = $shellcmd+ ' MaxRunTime=3600000'
$shellcmd = $shellcmd+ ' DontStartIfOnBatteries=0'
$shellcmd = $shellcmd+ ' KillIfGoingOnBatteries=0'
$shellcmd = $shellcmd+ ' RunOnlyIfLoggedOn=0'
$shellcmd = $shellcmd+ ' SystemRequired=0'
$shellcmd = $shellcmd+ ' DeleteWhenDone=1'
$shellcmd = $shellcmd+ ' Suspend=0'
$shellcmd = $shellcmd+ ' StartOnlyIfIdle=0'
$shellcmd = $shellcmd+ ' KillOnIdleEnd=0'
$shellcmd = $shellcmd+ ' RestartOnIdleResume=0'
$shellcmd = $shellcmd+ ' Hidden=0'
$shellcmd = $shellcmd+ ' TaskFlags=0'

$shellcmd = $shellcmd+ ' /CTJ StartDate='+$date
$shellcmd = $shellcmd+ ' StartTime='+$time
$shellcmd = $shellcmd+ ' HasEndDate=0'
$shellcmd = $shellcmd+ ' KillAtDuration=0'
$shellcmd = $shellcmd+ ' Disabled=0'
$shellcmd = $shellcmd+ ' Type='+$type
if $typeargs
$shellcmd = $shellcmd+ ' TypeArguments='+$typeargs
endif

$shellcmd = $shellcmd+ ' /SAJ "'+$name+'"'

shell '%COMSPEC% /e:1024 /c '+$shellcmd+' >NUL 2>NUL'
$scheduletask=@ERROR
exit @ERROR
endfunction


_________________________
Co