Page 1 of 2 12 LastLast
Results 1 to 15 of 18
  1. #1
    5 Star Lounger
    Join Date
    Jul 2001
    Location
    Terneuzen, Netherlands
    Posts
    895
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Capture text from DOS program via LPT?

    I have an old DOS program that prints its results to LPT1 (or LPT2 or LPT3; but nothing else). What I want is to capture the output in a file... [oh, by the way... the DOS program is running under Win98 -or XP-]...

    Now this sounds (and probably is) simple but I haven't been able to get this to work. I have a (modern) DeskJet printer on my LPT1, so I thought I could install a Text/Generic printer virtually on an LPT2:..... I must be missing something as that doesn't seem to work...

    Anyone with a clue? I could maybe think back to my DOS-times and get a TSR that would allow me to capture the LPT1: in DOS itself and save that to a file...

    Erik Jan

  2. #2
    Silver Lounger Bruce K's Avatar
    Join Date
    Apr 2002
    Location
    Phoenix, Arizona, USA
    Posts
    1,876
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Capture text from DOS program via LPT?

    Hi, Erik Jan ~

    If you would like to capture text from DOS in XP, it's this simple:<UL><LI>In the command window, right-click the titlebar > 'Edit' > 'Mark'<LI>Now use your cursor to select any text anywhere<LI>Hit 'Enter'<LI>Open Notepad or Word > paste and save[/list]

  3. #3
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Capture text from DOS program via LPT?

    What part isn't working about the Text/Generic print driver? That still seems like your best bet.

  4. #4
    5 Star Lounger
    Join Date
    Jul 2001
    Location
    Terneuzen, Netherlands
    Posts
    895
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Capture text from DOS program via LPT?

    Thanks, but that doesn't work as I want to capture the information that the DOS app is PRINTING, not the stuff that's on the screen...

  5. #5
    5 Star Lounger
    Join Date
    Jul 2001
    Location
    Terneuzen, Netherlands
    Posts
    895
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Capture text from DOS program via LPT?

    I don't know how to get the text printed to that driver... Should I capture a port? If yes, how?

  6. #6
    5 Star Lounger
    Join Date
    Jul 2001
    Location
    Terneuzen, Netherlands
    Posts
    895
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Capture text from DOS program via LPT?

    Thanks but no again... I'm not looking to capture screens but printed output from a DOS app...

  7. #7
    Banned Member
    Join Date
    Jul 2002
    Location
    Newport Richey, Florida, USA
    Posts
    2,149
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Capture text from DOS program via LPT?

    See if this is what your looking for Click Here

  8. #8
    Banned Member
    Join Date
    Jul 2002
    Location
    Newport Richey, Florida, USA
    Posts
    2,149
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Capture text from DOS program via LPT?

    Found This

    To capture a printer to LPT1 under NT, do the following

    net use /persistent:yes
    net use LPT1 servernamesharename

  9. #9
    5 Star Lounger
    Join Date
    Jul 2001
    Location
    Terneuzen, Netherlands
    Posts
    895
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Capture text from DOS program via LPT?

    I can do something similar under Win98 when I select to capture a port. Big question is what to fill-in for servernamesharename if I intend to redirect the output from e.g. LPTx: to my defined Text/Generic printer... that doesn't seem to work... that is my problem... try it yourself if possible and you'll see

  10. #10
    Banned Member
    Join Date
    Jul 2002
    Location
    Newport Richey, Florida, USA
    Posts
    2,149
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Capture text from DOS program via LPT?

    Heck no I have enough problems just printing <img src=/S/woops.gif border=0 alt=woops width=58 height=36>

  11. #11
    5 Star Lounger
    Join Date
    Jul 2001
    Location
    Terneuzen, Netherlands
    Posts
    895
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Capture text from DOS program via LPT?

    Yep, (that's the TSR-type solution I was also thinking of)... thanks for attaching the util, it works !!!!

    Erik Jan

    PS. This solution (again: it did help me, so I guess this is 'the solution' to my initial problem) is not Windows related. If anyone still knows how to 'catch' output in Windows, I'd be interested (just out of curiosity.

  12. #12
    Super Moderator
    Join Date
    May 2002
    Location
    Canberra, Australian Capital Territory, Australia
    Posts
    5,055
    Thanks
    2
    Thanked 417 Times in 346 Posts

    Re: Capture text from DOS program via LPT?

    Hi EricJan,

    If I understand, you want a Windows utility that will trap and save printer output from a DOS program.

    I don't know of such a utility, but you could use a batch file to install the utility I posted, then your DOS program and, when you exit the DOS program, uninstall the utility. Then, instead of running your DOS program directly, just run it via the batch file. Should achieve effectively the same result if you make the batch file available via an icon on the desktop and/or as a 'program' hanging off the start menu.

    Cheers
    Cheers,

    Paul Edstein
    [MS MVP - Word]

  13. #13
    Super Moderator
    Join Date
    May 2002
    Location
    Canberra, Australian Capital Territory, Australia
    Posts
    5,055
    Thanks
    2
    Thanked 417 Times in 346 Posts

    Re: Capture text from DOS program via LPT?

    Hi EricJan,

    Here's a TSR utility from Ziff Communications Co. that appeared in a magazine article years ago (1988, actually). It should do what you want.

    Cheers

    Usage: PRN2FILE [path] [filename] [ /Pn ] [ /Bnn ] [ /U ]
    where:
    path & filename are the target path & filename and, if omited, default to the current drive and path
    /Pn indicates which printer (1, 2 or 3) to redirect - useful if you have more than one. DOS uses LPT1 exclusively
    /Bnnn is the buffer size in Kb, and defaults to 4Kb - as a rule, specify the largest file size you're going to print
    /U uninstalls the application
    Cheers,

    Paul Edstein
    [MS MVP - Word]

  14. #14
    5 Star Lounger
    Join Date
    Jan 2001
    Location
    Newark, New Jersey, USA
    Posts
    999
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Capture text from DOS program via LPT?

    Setup a generic printer on any port, then go in and pull down the port, there is a FILE option. When you print to this 'printer', it will prompt you sor a file name.
    Mike Wolfman
    Jack of all, Master of none
    Bow before me, for I am root.
    <IMG SRC=http://www.wopr.com/w3tfiles/112673-wolfsig.jpg>

  15. #15
    5 Star Lounger
    Join Date
    Jul 2001
    Location
    Terneuzen, Netherlands
    Posts
    895
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Capture text from DOS program via LPT?

    I must be explaining the situation unclear....

    The application that prints is a DOS (!!) application; obviously that cannot print to "a printer" but just to a port (like LPT) [in this particulare DOS program I can choose LPT1, LPT2 or LPT3 only)...

Page 1 of 2 12 LastLast

Posting Permissions

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