Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re^3: Raw Data to Printer on Win XP

by BrowserUk (Patriarch)
on Sep 29, 2004 at 22:32 UTC ( [id://395155]=note: print w/replies, xml ) Need Help??


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

Does your usb device show up as a COMn: port if you do just issue the "mode" command alone?

If so, you can redirect LPT to it using

Redirect printing: MODE LPTn[:]=COMm[:]

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

Replies are listed 'Best First'.
Re^4: Raw Data to Printer on Win XP
by dvergin (Monsignor) on Sep 29, 2004 at 22:39 UTC
    >mode
    
    Status for device CON:
    ----------------------
        Lines:          300
        Columns:        80
        Keyboard rate:  31
        Keyboard delay: 1
        Code page:      437
    
    That's it. So I guess the answer to your question is 'No'. Is there a way to configure the USB port to appear that way?

      I think the answer is "Yes", but I don't have a usb printer (or any printer mine--died recently), with which to try this out, and I can't persuade the appropriate dialogs to pop up without one.

      The secret is to go into the printer configuration from Settings->Printers and Faxes. "Add a printer" if you haven't already done so. In that dialog (going on memory now) somewhere, there is an option to specify what device (LPTnn:) or COMnn:) you wish this printer to be known as.

      Assuming that you can find and successfully configure this, then printing a file should be as easy as copying it to the configured device.

      Sorry this is so vague. Good luck.


      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
        Gee, golly, how I hate admin-ing a system through a GUI. Not only is it a pain doing it. It's a pain documenting what you have done.

        Anyway, I did:

             Start / Settings / Printers_and_Faxes / Deskjet500 on USB
        
        That brings up a window for the printer. Then:
             Printer / Properties / Ports
        
        Here I selected the (previously unselected) LPT1: port. After a brief pause, the Printer column (previously empty) showed: "Deskjet500 on USB". Which seemed *very* promising.

        But "mode LPT1: /status" (with and without the colon after LPT1) in a _fresh_ CMD window still complains: "Illegal device name - LPT1".

        Perhaps if I reboot. Yes! That's it. A simple reboot and this'll all be behind me and I'll be able to get on with my life.   stand by...

        Update:
        No such luck. I still get:

        >mode LPT1: /status
        Illegal device name - LPT1
        
        >print testhere.pl
        Unable to initialize device PRN
        
        How do I cause LPT1 to exist on this system?

        POST FACTO NOTE: Don't re-assign a USB printer to the LPT1 port as described here. I later noticed that this selection unselected the proper assignment of this printer to the USB port. All this did was to assign a printer that I had named "Deskjet500 on USB" to the (non-existant) LPT1 port. The fact that I had named it "...on USB" had no significance for the system. And this clearly did not redirect LPT1 to the USB port even thought it looked that way on the screen. I had to go back and select the USB port to get my printer back.

Re^4: Raw Data to Printer on Win XP
by aquarium (Curate) on Sep 30, 2004 at 14:15 UTC
    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.

      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

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://395155]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (3)
As of 2024-03-19 05:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found