Results 1 to 11 of 11
  1. #1
    Star Lounger
    Join Date
    Feb 2003
    Location
    near Blairgowrie, Perthshire, Scotland
    Posts
    72
    Thanks
    0
    Thanked 0 Times in 0 Posts

    DIR > PRN problem (XP latest version)

    When I type DIR > PRN from the Command Prompt, I get an error because DIR will insist on trying to print to a printer which is no longer connected to this machine. It ignores the current default printer. Any ideas (presumably including a trip to the Registry)?

    Thanks

    Rex Last

  2. #2
    Plutonium Lounger Leif's Avatar
    Join Date
    Dec 2000
    Location
    U.K.
    Posts
    14,010
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: DIR > PRN problem (XP latest version)

    According to Windows XP Professional Product Information:
    <hr>dir > prn

    When you specify prn, the directory list is sent to the printer attached to the LPT1 port. If your printer is attached to a different port, you must replace prn with the name of the correct port. <hr>
    What is your default printer connected to?

  3. #3
    Platinum Lounger
    Join Date
    Jan 2001
    Location
    Quedgeley, Gloucester, England
    Posts
    5,333
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: DIR > PRN problem (XP latest version)

    Do <big>NET USE LPT1</big> and see where LPT1 is connected. It probably isn't!

    If you have a shared printer, then set up LPT1 where you want it by typing
    <big>NET USE LPT1 printservernameprintersharename</big>

    If you only have USB-connected printers and no server, then you're stuck with doing it from Windows 'somehow'.
    For example do DIR to a text file, then load it into NOTEPAD and print it from there.
    <big>DIR > $.txt & NOTEPAD $.txt</big>

    John
    <font face="Script MT Bold"><font color=blue><big><big>John</big></big></font color=blue></font face=script>

    Ita, esto, quidcumque...

  4. #4
    Star Lounger
    Join Date
    Feb 2003
    Location
    near Blairgowrie, Perthshire, Scotland
    Posts
    72
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: DIR > PRN problem (XP latest version)

    Yes. That's the problem. My default printer is USB. In fact all three of my printers are USB! The ex-printer was LPT1.

    Rex Last

  5. #5
    Plutonium Lounger Leif's Avatar
    Join Date
    Dec 2000
    Location
    U.K.
    Posts
    14,010
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: DIR > PRN problem (XP latest version)

    There appears to be a solution here:
    HOWTO: Print to a USB Printer from DOS in Windows XP
    which uses the Loopback Adapter.

    Any use?

  6. #6
    Platinum Lounger
    Join Date
    Jan 2001
    Location
    Quedgeley, Gloucester, England
    Posts
    5,333
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: DIR > PRN problem (XP latest version)

    I came across DOS2USB for $20, which might be of some use?

    Alternatively, try the following:
    * Go to Printers and Faxes and right-click on a favourite printer, then click on Properites, then choose the Sharing tab.
    * Click on the Share this printer button, and give it a share name (preferably 8 characters or fewer, without spaces).

    Use the Net Use LPT1 command in my previous post, with the name of your computer as the "printservername" and the share name you've just set up as the printersharename, and see how you get on. My HP DeskJet 990cxi doesn't power itself on automatically, and the data light keeps flashing after it's printed the page, but you can't have everything...

    John
    <font face="Script MT Bold"><font color=blue><big><big>John</big></big></font color=blue></font face=script>

    Ita, esto, quidcumque...

  7. #7
    Star Lounger
    Join Date
    Feb 2003
    Location
    near Blairgowrie, Perthshire, Scotland
    Posts
    72
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: DIR > PRN problem (XP latest version)

    Setting up Sharing (without using the Wizard) worked like a charm. Thanks a lot!

    Rex Last

  8. #8
    Platinum Lounger
    Join Date
    Jan 2001
    Location
    Quedgeley, Gloucester, England
    Posts
    5,333
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: DIR > PRN problem (XP latest version)

    I'm glad it worked!

    You know you can add /PERSISTENT:YES to the end of the statement so that the NET USE assignment is held "permanently"?
    So it becomes
    <big>NET USE LPT1 printservernameprintersharename /P:Y</big>

    John
    <font face="Script MT Bold"><font color=blue><big><big>John</big></big></font color=blue></font face=script>

    Ita, esto, quidcumque...

  9. #9
    Star Lounger
    Join Date
    Feb 2003
    Location
    near Blairgowrie, Perthshire, Scotland
    Posts
    72
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: DIR > PRN problem (XP latest version)

    Further to the DIR > PRN problem, I have just dug out KB article 314499 which shows how to print any file using the shared printer. Here's part of a DOS session:

    d:alldocsw2>help print
    Prints a text file.

    PRINT [/D:device] [[drive:][path]filename[...]]

    /D:device Specifies a print device.


    d:alldocsw2>print /d:Rex_LastHPLaser d:alldocsw2fred
    D:alldocsw2fred is currently being printed

    Rex Last

  10. #10
    Platinum Lounger
    Join Date
    Jan 2001
    Location
    Quedgeley, Gloucester, England
    Posts
    5,333
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: DIR > PRN problem (XP latest version)

    Another way (if LPT1 has been assigned already) is to COPY the text file to the printer, as in
    <big>COPY somefile.txt LPT1</big> or <big>PRN</big>, if you want to save typing a character!

    Doing
    <big>COPY somefile.txt printservernameprintersharename</big>
    also works, more or less...

    John
    <font face="Script MT Bold"><font color=blue><big><big>John</big></big></font color=blue></font face=script>

    Ita, esto, quidcumque...

  11. #11
    5 Star Lounger st3333ve's Avatar
    Join Date
    May 2003
    Location
    Los Angeles, California, USA
    Posts
    705
    Thanks
    0
    Thanked 2 Times in 2 Posts

    Re: DIR > PRN problem (XP latest version)

    Also note that Notepad has a /p switch, so you can create a batch file that uses Notepad to print a text file (into which you've directed your Dir output) and closes. That kind of "PrintDir" batch file is Microsoft's official method for creating an Explorer right-click command that prints a list of the files in the right-clicked folder, and you can find their "PrintDir" batch file at the link.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •