Rob van der Woude's Scripting Pages
Powered by GeSHi

Source code for defprn.cmd

(view source code of defprn.cmd as plain text)

  1. /* Sample code to query the default printer port */
  2. /* Lee S. Fields                                 */
  3. /*                                               */
  4. /* No guarantees, but it works for me.           */
  5. /*                                               */
  6. /* Modified 1998/12/21, by Rob van der Woude:    */
  7. /* added RPL support                             */
  8.  
  9. parse arg bootdrive dummy
  10. if dummy <> "" then call Syntax
  11. if bootdrive = "" then do
  12. 	parse upper value value( "PATH", , "OS2ENVIRONMENT" ) with ":\OS2\SYSTEM" -1 bootdrive +2
  13. end
  14. bootdrive = strip( bootdrive, "T", "\" )||"\"
  15. user   = bootdrive||"OS2\OS2.INI"
  16. system = bootdrive||"OS2\OS2SYS.INI"
  17.  
  18. if RxFuncQuery( "SysLoadFuncs" ) <> 0 then do
  19. 	call rxfuncadd "SysLoadFuncs", "RexxUtil", "SysLoadFuncs"
  20. 	call sysloadfuncs
  21. end
  22.  
  23. defprn  = SysIni( user, "PM_SPOOLER", "PRINTER" )
  24. defprn  = strip( defprn, , "00"X )
  25. defprn  = strip( defprn, , ";"   )
  26. defport = SysIni( system, "PM_SPOOLER_PRINTER", defprn )
  27. parse value defport with defport";"defprn";".
  28. parse value defprn with dummy"."defprn
  29.  
  30. say "Default printer is "||defprn||" on "||defport
  31. exit
  32.  
  33. Syntax:
  34. 	say
  35. 	say "Usage: DEFPRN  [ boot_drive ]"
  36. 	say
  37. 	say "       For RPL images boot_drive should be specified as"
  38. 	say "       \\ripl_server\WRKFILES\pc_id\"
  39. 	exit
  40. return
  41.  

page last modified: 2024-04-16; loaded in 0.0200 seconds