home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 35 Internet / 35-Internet.zip / ping-w4.zip / sample.cmd < prev   
OS/2 REXX Batch file  |  1997-03-01  |  989b  |  35 lines

  1. /* -------------------------------------------------------- */
  2.  
  3. if RxFuncQuery("SysLoadFuncs") then do
  4.    rc = RxFuncAdd('SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs')
  5.    rc = SysLoadFuncs()
  6. end
  7.  
  8. /* -------------------------------------------------------- */
  9.  
  10. ping.exe = 'ping.exe'       /* Program executable name */
  11. ping.num = '1'              /* Number of times to ping */
  12.  
  13. host.1 = 'hobbes.nmsu.edu'
  14. host.2 = 'ftp-os2.cdrom.com'
  15. host.3 = 'www.os2ss.com'
  16.  
  17. /* host.4 = 'myfriend.static.ip.com' */
  18.  
  19. /* -------------------------------------------------------- */
  20. parse value SysTextScreenSize() with trow tcol
  21. parse value SysCurPos() with row col
  22. i=1
  23. do while host.i <> 'HOST.'i
  24.   call charout, left('Pinging' host.i'...',tcol-1)
  25.   rc=SysCurPos(row,0)
  26.   '@'ping.exe '-h -q -c 'ping.num host.i
  27.   if rc < 100 then found.i = 1
  28.   i=i+1
  29. end
  30. i=1
  31. do while host.i <> 'HOST.'i
  32.   if found.i <> 'FOUND.'i then say left('Currently connected:' host.i,tcol-1)
  33.   i=i+1
  34. end
  35.