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


in reply to Raw Data to Printer on Win XP

terra incognita had the right idea even though id did not look like it. Use the net use command given, but put in the name of your local pc using quotes if your pc has spaces in its name. I know it looks funny, but that is the way. Then use net view \\hostname to see that it is there. Be sure to print the Control-Z at the end of the job to get the output to show up...

HTH, --traveler

Replies are listed 'Best First'.
Re^2: Raw Data to Printer on Win XP
by dvergin (Monsignor) on Sep 30, 2004 at 00:21 UTC
    Rapturous, demented gibbering and giggling fills the air...

    Success! Okay, let's doc this puppy.

    First, I took the trouble to go to

    Start / Settings / Printers_and_Faxes / Deskjet500 on US 
        / Printer / Properties / Sharing
    
    And clicked on "Share this Printer" and gave my printer a share name.

    Then, at a command prompt (mmm... command prompt, good!), the following did ensue:

    >net view \\GatewayM275
    Shared resources at \\GatewayM275
    
    Dv's Gateway M275
    
    Share name  Type   Used as  Comment
    -------------------------------------------------------------------------------
    DJUSB002    Print           DeskJet 500 on USB
    Printer     Print           Journal Note Writer
    SharedDocs  Disk
    The command completed successfully.
    
    >net use LPT1: \\GatewayM275\DJUSB002
    The command completed successfully.
    
    >net view \\GatewayM275
    Shared resources at \\GatewayM275
    
    Dv's Gateway M275
    
    Share name  Type   Used as  Comment
    -------------------------------------------------------------------------------
    DJUSB002    Print  LPT1     DeskJet 500 on USB
    Printer     Print           Journal Note Writer
    SharedDocs  Disk
    The command completed successfully.
    
    >echo Hello > LPT1:
    
    And the most beautiful sound did issue forth from my printer. Likewise for:
    >print test.txt
    

    Thanks to all who have contributed to this thread. My wife just called me to come home for dinner. I've blown much of the afternoon on this, but I'm outta here!

    ------------------------------------------------------------
    "Perl is a mess and that's good because the
    problem space is also a mess.
    " - Larry Wall

      OMG - all that to just "DWIM"...

      I'll make sure I give my Linux boxes an extra big hug before I go to bed tonight !!!

      use brain;