I use the following code at times to send a message to PC's on the network.


Break ON

If RedirectOutput("c:\mess_results.TXT",0) = 0
  If Open (1,"CorpPCnames.TXT",0) = 0
    ?"Began sending messages at "@TIME
    $dest = ReadLine(1)
    While @ERROR = 0 
      $msg='Message goes here'
      SendMessage($dest,$msg)
      ? 'Sending message to $dest... = '+@ERROR+' - '+@SERROR 
      $dest = ReadLine(1)
    Loop
    ?"Completed sending messages at "@TIME
    $RC = Close (1)
  EndIf
EndIf
If
  RedirectOutput("")=0 
EndIf
Exit 0



The problem is that it is fairly slow. If a PC is not on the network at the time the message is sent, it slows down considerably. Issuing a ping before sending and then checking for a response takes longer than waiting for the SENDMESSAGE to time out.

Any suggestions?