Here is a service stop|start routine that i came up with, to stop and restart a remote service.

You need to assign the variables $service, $target, and $tempfile for this routine to work. It also used the program xnet.exe that came with kix to stop and start the services.

code:

:StartStop
? "Stopping and restarting $service on $target"
? shell '%comspec% /c xnet stop $target\$service'
do
shell '%comspec% /c xnet list $target | find /i "$service" > $tempfile'
$nul = open(2,$tempfile,2) $data = readline(2) $nul = close (2) del $tempfile
"." sleep 1
until substr("$data",63,len("$data")) = "stopped"
? shell '%comspec% /c xnet start $target\$service'
return

Now all you need to do is figure out if the service is running like it should be...

Bryce