Contents of the LPTX.DOC file
LPTx : Line Printer Output Capture Routine
(C)Copyright 1986 by Mark DiVecchio, All Rights Reserved
You may use and freely distribute this program for
DISCLAMER : this program tries to perform a function which is not supported by
DOS. It will work sometime and will not work other times. That kind of explains
why you don't see this type of program on the market. I have tested it under DOS
2.1. Some users have reported trouble when running under DOS 3.x and for other
users it works fine. USE AT YOUR OWN RISK.
Mark C. DiVecchio
9067 Hillery Drive
San Diego, CA 92126
First - some thanks... I would like to thank all of the users who have
called me about v3.00 of LPTx which has been floating around for about a year.
The program has met with mixed success. There seems to be no pattern as to when
the program works and when it doesn't. I am still searching for the solution to
this very difficult problem.
Have you ever wanted to get some data from your screen into a program?
Have you ever wanted to grab onto some printer data and put it into a disk file
but the program you are using does not have that as a option? Well here is the
answer to your problem. This program will grab onto anything sent out of a line
printer port as long as the program uses the standard BIOS INT 17h call. I have
tried this with printscreen, with printscreen in graphics mode (produces some
mighty unusual output), with SIDEWAYS, with the copy command to LPT1: etc, with
my word processor (FinalWord), with MASM (direct output to LPT1) with Wordstar,
with 1-2-3 and with the DOS '>' redirection command line option. It all seems to
This program intercepts the BIOS interrupt 17, the line printer
interrupt. It will redirect the output of LPT1, LPT2, or LPT3 to a disk file.
All three redirections may be active at the same time.
LPTx requires DOS 2.0 or later. It has not been tested on the new
version 3.x of DOS.
lptx -1 -o
where -1 means redirect LPT1, -2 means redirect LPT2, -3 means redirect
This option must appear first
-o means start the redirection to file specified. If redirection
is already in progress for the selected line printer,
the old file will be closed first.
(If you do not specify -o but you do specify a line printer,
LPTx will use either the last file name that you gave when
you loaded LPTx or will use the file named LPTXy.LST which it
will create in the root directory on the default drive - where
y is 1, 2, or 3.)
It is not necessary that you specify the complete path name
for the file. LPTx will create the file in the default
directory if you don't specify a directory. LPTx will always
be able to find the file because it saves the complete path.
-c means close the file and send all further output directly to the
If neither option is specified, LPTx just displays the program status.
note: -1, -2, and -3 are mutually exclusive
-o and -c are mutually exclusive
lptxDisplays the program status
lptx ?Displays a HELP screen
lptx -1redirects LPT1 output to file named
LPTX1.LST in the root directory
on the default drive or the last
lptx -o a:\able.xxxredirects LPT1 output to file named
ora:\able.xxx. Any open redirection
lptx a:\able.xxxdisk file for LPT1 is closed.
lptx -2 b:xx.lstredirects LPT2 output to file named
XX.LST in the default directory
on drive B:. Any open redirection
disk file for LPT2 is closed.
lptx -3 d:\ab\cd\file.lstredirects LPT3 output to the file named
file.lst in the directory ab\cd on drive
lptx -ccloses any disk files open for LPT1 and sends
orthe output back to the line printer
lptx -1 -cIf no redirection is taking place to LPT1,
this isa NOP. LPT2 and LPT3 are not
lptx -2 -ccloses any disk file open for LPT2 and
sends the output back to line printer.
if no redirection is taking place to LPT2,
this is a NOP. LPT1 and LPT3 are not
By redirecting LPT2 or LPT3 to a disk file, you can in effect have 2 or
3 printers on your system. LPT1 can be your physical printer and you can have
LPT2 output going to disk. When you redirect LPT2 or LPT3, LPT1 works normally.
If you are redirecting to a diskette file, do not remove the diskette
once the redirection starts. I recommend redirecting to a hard disk or a RAM
If LPTx encounters any kind of error during the redirection, it
terminates operation and sends output back to the line printer. It does not
display anything but beeps the speaker four times. This prevents your currently
running program from possibly getting destroyed. An error with LPT1 redirection
does not shut down LPT2 or LPT3 redirection.
LPTx captures the int 17h interrupt vector. Problems may occur with
print spoolers which also take over the int 17h vector. You can be sure that
LPTx works correctly by running LPTx after you have run your print spooler. LPTx
will be transparent to the print spooler but your print spooler may not be
transparent to LPTx. LPTx works fine with IBM's PRINT command.
LPTx also captures the int 24h critical error interrupt vector. This is
done only for the period that LPTx is using the disk. This prevents the
generation of funny error messages in the middle of other programs that you may
be running. (LPTx just beeps 4 times and clears itself out of way if a disk
This version of LPTx can redirect all three printers to three different
files with all 3 active at the same time.
LPTx uses about 7K of memory for the resident data buffers and interrupt
If you modify or find any bugs in this program, I would appreciate it if
you would drop me a line with the changes. Use the address above.