http://www.perlmonks.org?node_id=395353


in reply to Re^3: Raw Data to Printer on Win XP
in thread Raw Data to Printer on Win XP

i was of the understanding that usb printer drivers communication is different than on parallel, so i don't think it will work -- otherwise you can create any port you like in the windows printer control panel. and if the MODE thing doesn't work for you, there's a win32 port re-director called "redmon". If redirecting from lpt1 to usb works for you, please let us know.

Replies are listed 'Best First'.
Re^5: Raw Data to Printer on Win XP
by BrowserUk (Patriarch) on Sep 30, 2004 at 14:58 UTC

    As I said, I don't have a usb printer, so I cannot test he theory. However, I belive that usb printers are basically serial printers eg. COMn:-like. I do know that you can redirect LPT1 to COMn:

    P:\test>mode /status Status for device LPT1: ----------------------- Printer output is not being rerouted. Status for device COM1: ----------------------- Baud: 1200 Parity: None Data Bits: 7 Stop Bits: 1 Timeout: OFF XON/XOFF: OFF CTS handshaking: OFF DSR handshaking: OFF DSR sensitivity: OFF DTR circuit: ON RTS circuit: ON P:\test>mode /status Status for device LPT1: ----------------------- Printer output is being rerouted to serial port COM1 Status for device COM1: ----------------------- Baud: 1200 Parity: None Data Bits: 7 Stop Bits: 1 Timeout: OFF XON/XOFF: OFF CTS handshaking: OFF DSR handshaking: OFF DSR sensitivity: OFF DTR circuit: ON RTS circuit: ON

    So, if usb are (or present themselves to the system as) serial ports, then it is entirely possible to re-route LPT1 to a usb printer.

    The OP chose to set his usb printer to masquarade as LPT1 directly. Personally I would have chosen to have it set as a COM1:, then, should I ever attach a second printer to a serial port or another usb, I could set that to COM2: and chose which of the two my CLI apps wrote to by using the MODE command above.

    I've had this set up on networked systems with half a dozen different local and network printers and it make life quite convenient.


    Examine what is said, not who speaks.
    "Efficiency is intelligent laziness." -David Dunham
    "Think for yourself!" - Abigail
    "Memory, processor, disk in that order on the hardware side. Algorithm, algorithm, algorithm on the code side." - tachyon