Thanks Lonkero,
I truly appreciate the word "quick" from you about me and my KixTart thinking. Just in case here's my untested script:
code:
Call library.udf
; define task
$name='demo.job'
$name1='demo2.job'
$user='administrator'
$pw='adminpassword'
; enumerate all computers
$domaincomps=comnetview()
; schedule task for each computer
For Each $comp In $domaincomps
? 'Scheduling task on '+$comp
$rc=scheduletask2($name,$name1,$comp,$user,$pw,)
Next
; exit with success code
Exit 0
with this as the fnSchedultask2() ( modified from Jens' UDF "Scheduletask()" )
code:
Function scheduletask2($name, name1, $comp, $user, $pw,)
Dim $jtexe, $shellcmd, $retcode
If $name='' OR $name1='' OR $comp='' ;date='' OR $time='' OR $type=''
Exit 87
EndIf
If $user='' OR $pw=''; OR $comment=''OR $command=''
Exit 87
EndIf
If NOT VarType($parameters)
Dim $parameters
$parameters=''
EndIf
; this should point to your copy of jt.exe
$jtexe='jt.exe'
If NOT Exist($jtexe)
Exit 2
EndIf
; delete a potentially existing task
$shellcmd = $jtexe
$shellcmd = $shellcmd+ ' /SC '+$user+' "'+$pw+'"'
$shellcmd = $shellcmd+ ' /SM \\'+$comp
$shellcmd = $shellcmd+ ' /SD "'+$name+'"'
Shell '%COMSPEC% /e:1024 /c '+$shellcmd
$shellcmd = $jtexe
$shellcmd = $shellcmd+ ' /SVJ '+$name
$shellcmd = $shellcmd+ ' /lJ '+$name1
$shellcmd = $shellcmd+ ' /SC '+$user+' "'+$pw+'"'
$shellcmd = $shellcmd+ ' /SM \\'+$comp
Shell '%COMSPEC% /e:1024 /c '+$shellcmd
$scheduletask=@ERROR
Exit @ERROR
EndFunction
[ 10. July 2003, 10:06: Message edited by: didlyjack ]