Jens,

I have updated the script with the latest version of ScheduleTask (). It gives an error 87:

Quote:


Task will be scheduled on comp1 on 2004/01/05 at 23:58
Error 87 - The parameter is incorrect.

Task will be scheduled on comp2 on 2004/01/06 at 00:28
Error 87 - The parameter is incorrect.





I have changed $d in $date and remmed out d$:
Code:

For Each $comp In $computers

; filter
;------------------------------
;$os = osid($comp)
;
;If $os[1]='Win2K' AND $os[2]<>'Workstation' AND InStr($comp,"comp")<>0


; Date /Time
;------------------------------
$time=serialtime(serialtime($time)+serialtime($timediff))
$day=Val(Split($time,':')[0])
$hour=Split($time,':')[1]
$minute=Split($time,':')[2]
$time=$hour+':'+$minute
If $time='24:00'
$time='00:00'
$date=DateMath($date, 1)
EndIf
If $day>0
$date=DateMath($date, $day)
EndIf

; Date Format
;------------
;$d = Split($date,'/')[1] + '/' + Split($date,'/')[2] + '/' + Split($date,'/')[0]


; Schedule Task
;------------------------------
?''
? 'Task will be scheduled on '+$comp+' on '+$date+' at '+$time
$rc=scheduletask($name, $comp, $date, $time, $type, $cmd)
? 'Error '+@ERROR+' - '+@SERROR

Next





Edited by Co (2004-01-05 12:49 PM)
_________________________
Co