Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Tool to create a new printer?

1 view
Skip to first unread message

Alex Taylor

unread,
Jan 4, 2011, 9:23:03 PM1/4/11
to
Is there a command-line utility out there which is capable of creating
a new printer?

That is, given a driver (e.g. ECUPS.DRV), model name (e.g. "Epson PX
101"), and output port (e.g. "CUPS4"), it will create both a queue
and a WPS object?

I'm trying to automate this process from a (REXX) program.

--
Alex Taylor
Fukushima, Japan
http://www.socis.ca/~ataylo00

Please take off hat when replying.

Peter Flass

unread,
Jan 4, 2011, 10:35:52 PM1/4/11
to
On 1/4/2011 9:23 PM, Alex Taylor wrote:
> Is there a command-line utility out there which is capable of creating
> a new printer?
>
> That is, given a driver (e.g. ECUPS.DRV), model name (e.g. "Epson PX
> 101"), and output port (e.g. "CUPS4"), it will create both a queue
> and a WPS object?
>
> I'm trying to automate this process from a (REXX) program.
>

Isn't there a REXX "create object" function in Rexxutil? If so, this
should do it. Dredging back in my memory, wasn't there a Rexx function
to create a bunch of LPR ports and printers? Sorry to be so vague - I
hope this is some help.

Lars Erdmann

unread,
Jan 4, 2011, 11:01:59 PM1/4/11
to
Alex Taylor wrote:
> Is there a command-line utility out there which is capable of creating
> a new printer?
>
> That is, given a driver (e.g. ECUPS.DRV), model name (e.g. "Epson PX
> 101"), and output port (e.g. "CUPS4"), it will create both a queue
> and a WPS object?
>
> I'm trying to automate this process from a (REXX) program.
>
Have a look at the "Workplace Shell Programming Reference":
"WPPrinter" class has a bunch of setup keynames:
PRINTDRIVER
PORTNAME
QUEUENAME
QUEUEDRIVER

The "Model name" would most likely also be the title of the WPS object.

If you want to know the format of the strings to pass along, use regedit2.exe
-> HINI_SYSTEM_PROFILE -> PM_SPOOLER_DD
-> PM_SPOOLER_PORT
-> PM_SPOOLER_QUEUE_DD
-> PM_SPOOLER_QUEUE
-> PM_SPOOLER_QP

With a little trial and error you should be able to figure out the correct strings for the setup keynames.

Example: PRINTDRIVER would be something like "ECUPS.Epson PX 101" and PORTNAME would be "CUPS4".
For QUEUEDRIVER that would likely be "PMPRINT" (if you use the default queue processor \OS2\DLL\PMPRINT.QPR)
What you specify as QUEUENAME will end up as a subdirectory created under \var\spool. It's the place where
the spooled print jobs will be placed. For example QUEUENAME would be "Epson_Px101".

See also all the other setup keywords. You will need to use additional ones to achieve a "silent installation".


Lars

Dave Yeo

unread,
Jan 5, 2011, 12:40:03 AM1/5/11
to
Alex Taylor wrote:
> Is there a command-line utility out there which is capable of creating
> a new printer?
>
> That is, given a driver (e.g. ECUPS.DRV), model name (e.g. "Epson PX
> 101"), and output port (e.g. "CUPS4"), it will create both a queue
> and a WPS object?
>
> I'm trying to automate this process from a (REXX) program.
>

F:\UTILS>prndrv.exe
PrnDrv -- OS/2 Printer Driver Installer/Deinstaller
Developed by Keller Group Inc.
Copyright (c) 1991-1999 Keller Group Inc. All rights reserved.

usage:
PrnDrv -l - list all queues and printers
PrnDrv -p - purge all Keller Group
queues/printers
PrnDrv -d name - delete queues/printers
containing name
PrnDrv -s other_options - enables 'silent' operation
PrnDrv -i x:\path\FxPrint.drv - install driver on suitable LPT
PrnDrv -i x:\path\FxPrint.drv LPT3 - install driver on specified LPT
PrnDrv -i x:\path\FxPrint.drv LPT3 special_job_properties

I downloaded it from http://www.os2site.com/sw/comm/faxworks/prndrv.exe
and have only used it to delete printer drivers.
Dave

Alex Taylor

unread,
Jan 7, 2011, 6:36:01 AM1/7/11
to
On Wed, 5 Jan 2011 04:01:59 UTC, Lars Erdmann <lars.e...@arcor.de> wrote:

> Have a look at the "Workplace Shell Programming Reference":
> "WPPrinter" class has a bunch of setup keynames:
> PRINTDRIVER
> PORTNAME
> QUEUENAME
> QUEUEDRIVER
>

> Example: PRINTDRIVER would be something like "ECUPS.Epson PX 101" and
> PORTNAME would be "CUPS4".
>

> See also all the other setup keywords. You will need to use additional
> ones to achieve a "silent installation".

Thanks for pointing that out, I'd forgotten I could do that.

OTOH, I'm not sure this provides a facility for installing the print
device, or the port, if neither are installed yet.


In fact, though, I've been pointed to RINSTPRN.EXE, which is the
CID printer installer... it seems quite capable. I'm going to play
with that and see if it does the job.

If not, I may go back to the setup strings...


Thanks for this and the other suggestions, guys!

0 new messages