Mmm, It works but I'm not really satisfied.
Code:
For Each $comp In $computers
; filter
;------------------------------
;$os = osid($comp)
;
;If $os[1]='Win2K' AND $os[2]<>'Workstation' AND InStr($comp,"comp")<>0
;
;
$time=serialtime(serialtime($time)+ serialtime($timediff))
; Date
;------------------------------
;
? $time
? $date
$d = Split($date,'/')[1] + '/' + Split($date,'/')[2] + '/' + Split($date,'/')[0]
? $d
; Schedule Task
;------------------------------
;
$rc=scheduletask($name, $comp, $d, $time, $type, $cmd)
? 'Error '+@ERROR+' - '+@SERROR
Next
Changing the date format works OK. When time is for example 23:59 there is a problem because the date will not change in next day's date.
I have to change this part. When time has past midnight the date must be changed to next day's date....
Code:
If $time='00:00' OR $time='24:00'
$date= DateMath($date, 1)
EndIf
Quote:
23:29
2003/12/30
12/30/2003
Error 0 - The operation completed successfully
UDF Serialtime 0
23:59
2003/12/30
12/30/2003
Error 0 - The operation completed successfully
UDF Serialtime 0
-1
2003/12/30
12/30/2003
Error 1 - Incorrect function.
UDF Serialtime 1
UDF Serialtime 0
-1
2003/12/30
12/30/2003
Error 1 - Incorrect function.
UDF Serialtime 1
Sealeopard's Serialtime UDF without seconds and miliseconds
Code:
Function serialtime($strtime)
Dim $hours, $minutes
If InStr($strtime,':')
$strtime=Split($strtime,':')
Select
Case Ubound($strtime)<1
ReDim preserve $strtime[1]
Case Ubound($strtime)>1
$serialtime=-1
Exit 87
EndSelect
$hours=Val($strtime[0])
If $hours<0 OR $hours>23
$serialtime=-1
Exit 87
EndIf
$minutes=Val($strtime[1])
If $minutes<0 OR $minutes>59
$serialtime=-1
Exit 87
EndIf
$serialtime=0.0+($hours*3600)+($minutes*60)
Else
$strtime=Val(CDbl($strtime)*1000)
If $strtime<=86400000 AND $strtime>=0
$hours=$strtime/3600/1000
$strtime=$strtime-($hours*3600*1000)
$hours=Right('00'+$hours,2)
$minutes=$strtime/60/1000
$strtime=$strtime-($minutes*60*1000)
$minutes=Right('00'+$minutes,2)
$serialtime=$hours+':'+$minutes
Else
? 'UDF Serialtime' +Chr(9)+@ERROR+Chr(9)+$serialtime
$serialtime='-1'
Exit 87
EndIf
EndIf
EndFunction
Someone any ideas??
De beste wensen en een gelukkig nieuw jaar
Best wishes and a happy new year