home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Collection - Online Library - January 1996 / CKITOS2196.ISO / diskette / gg244043.dsk / unc.dsk / LS30UTIL / PRTENUM.CMD < prev    next >
OS/2 REXX Batch file  |  1993-03-05  |  2KB  |  57 lines

  1. /*******************************************************************/
  2. /* PRTENUM.CMD                                                     */
  3. /*                                                                 */
  4. /* Display information of the printer ports of a server.           */
  5. /*                                                                 */
  6. /* The server machine ID must be used.                             */
  7. /*                                                                 */
  8. /* For example:  PRTENUM \\OURSRV                                  */
  9. /*                                                                 */
  10. /*******************************************************************/
  11.  
  12. parse upper arg serverId dummyArg
  13.  
  14. call LoadFuncs; /* Load DLL utility functions */
  15.  
  16. if serverId = '' then do
  17.  say 'Specify a server machine ID'
  18. end
  19.  
  20. rc = NetEnum('printdev',serverId,'prtInfo.')
  21. if rc = '0' then do
  22.  say serverId
  23.  do i=1 to prtInfo.0
  24.   say prtInfo.i
  25.  end
  26. end
  27. else do
  28.  say 'Error while obtaining printer information. Returncode from NetEnum() was:'
  29.  say rc
  30.  exit 9
  31. end
  32.  
  33. call DropFuncs
  34. exit 0
  35.  
  36. /*************************************************************/
  37. /* Load DLL Functions                                        */
  38. /*************************************************************/
  39. LoadFuncs:
  40.  
  41.  /* Load LS30UT.DLL functions */
  42.  call RxFuncAdd 'LoadLs30utFuncs', 'LS30UT', 'LoadLs30utFuncs'
  43.  call LoadLs30utFuncs
  44.  
  45. return
  46.  
  47. /*************************************************************/
  48. /* Drop DLL Functions                                        */
  49. /*************************************************************/
  50. DropFuncs:
  51.  
  52.  /* Drop LS30UT.DLL functions */
  53.  call DropLs30utFuncs
  54.  
  55. return
  56.  
  57.