home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 8 Other / 08-Other.zip / lsmt213c.zip / lspres.cmd < prev    next >
OS/2 REXX Batch file  |  2000-04-18  |  2KB  |  75 lines

  1. /*---------------------------------------------------------------------------*\
  2. |   LAN Server Presence Check                 (C) Alain Rykaert - MAR96-APR00 |
  3. \*---------------------------------------------------------------------------*/
  4.  
  5.     Parse Arg ServerName
  6.  
  7.     Call Init                                   /* load DLL's & other stuff*/
  8.  
  9.     If ServerName = ''
  10.       Then Do
  11.              Say '*'
  12.              Say '* LAN Server Presence Check'
  13.              Say '*'
  14.              Say '* Usage: LSPRES {ServerName}'
  15.              Say '*'
  16.              Say '* Sample: LSPRES \\DC02'
  17.              Say '*'
  18.              Exit X2D('1600')
  19.            End
  20.       Else Nop
  21.  
  22.     ServerName = Strip(ServerName,'L','\')
  23.  
  24.     Call CharOut,'* Server Name:' '\\'ServerName
  25.  
  26.     RC = NetGetInfo(370, 'ServerModalInfo', '\\'ServerName)
  27.     If RC = 0
  28.       Then Do
  29.              Say ' : OK'
  30.              Exit X2D('FE00')
  31.            End
  32.       Else Do
  33.              Say ' : Not OK'
  34.              Exit X2D('0800')
  35.            End
  36.  
  37.     Exit
  38.  
  39.  INIT:/* --------------------------------------------------------------------*/
  40.  
  41.    '@echo off'
  42.     BootDrive = Left(Value('ComSpec',,'OS2Environment'),2)
  43.  
  44.     If RxFuncQuery('SysLoadFuncs')
  45.       Then Do
  46.              Call RxFuncAdd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs'
  47.              Call SysLoadFuncs
  48.            End
  49.       Else Nop
  50.  
  51.     LSRDrive = Left(SysSearchPath('PATH', 'NET.EXE'), 2)    /* IBMLAN Drive*/
  52.     If LSRDrive <> ''
  53.       Then Nop
  54.       Else Do
  55.              Say '! Could not determine the Lan Requester path' '07'x
  56.              Exit X2D('1604')
  57.            End
  58.  
  59.     If Stream(LSRDrive'\ibmlan\netlib\lsrxut.dll', 'C', 'Query Exists') <> ''
  60.       Then Do
  61.              If RxFuncQuery('LoadLSRXUTFuncs')
  62.                Then Do
  63.                       Call RxFuncAdd 'LoadLsRxutFuncs', 'LSRXUT', 'LoadLsRxutFuncs'
  64.                       Call LoadLsRxutFuncs
  65.                     End
  66.                Else Nop
  67.            End
  68.       Else Do
  69.              Say '! Could not find' LSRDrive'\IBMLAN\NETLIB\LSRXUT.DLL' '07'x
  70.              Exit X2D('0800')
  71.            End
  72.  
  73.     Return
  74.  
  75.