Dec 082017
Sharware Program to Redirect LPT to Disk File.
File LPTZ.ZIP from The Programmer’s Corner in
Category Printer Utilities
Sharware Program to Redirect LPT to Disk File.
File Name File Size Zip Size Zip Type
LPTZ.COM 14946 6471 deflated
LPTZ.DOC 35839 9787 deflated

Download File LPTZ.ZIP Here

Contents of the LPTZ.DOC file

L P Tz



v 1.00

COPYRIGHT (c) 1990 by James P. Morgan

This document describes the LPTz printer redirector program,
which was created by James P. Morgan, in February of 1990.

Shareware version 1.00 is initially being distributed on

1). THE PUBLIC (software) LIBRARY

P. O. Box 35705
Houston TX 77235-5705

Ph :713-721-5205 - 713-721-6104

2). PC ROCKLAND BBS - NY (bulletin board, one of the BEST)

Download file : LPTzV100.ZIP

Ph :914-353-2538 (open public - non-subscribers)
914-353-2157 (paid subscribers only)


James P. Morgan ("supplier") makes no warranties, either expressed
or implied, with respect to this documentation or with respect to the
software described in this publication, its quality, performance,
merchantability or fitness for any particular purpose. The software is
sold or licensed "as is". The entire risk as to its quality and performance
is with the buyer. Should the programs prove defective following their
purchase, the buyer (and not the suppliers, not their distributor or
retailer) assumes the entire cost of all necessary servicing, repair,
or correction and any incidental or consequential damages. In no event
will suppliers be liable for direct, indirect, incidental or consequential
damages resulting from any defect in the software, even if suppliers have
been advised of the possibility of such damages. Some states do not allow
the exclusion or limitation of implied warranties or liability for
incidental or consequential damages, so the above limitation or exclusion
may not apply to you.



Welcome to LPTz!

LPTz is a printer redirector.

What this means is that LPTz will intercept (capture) the data
that is directed to a printer (i.e. LPT1/LPT2/LPT3) and send the
data to a disk file.

Why would you want to do this?. Well, some programs don't allow
their printer output to be sent directly to a disk file, so LPTz
could 'add' this function to such a program. Then you could 'use'
the captured printer data later, say to give to someone else or
perhaps to delay physical printing. Your real printer may not
have been available at the time you needed to generate the print

You don't have a printer!. Unusual, but you don't need a real
printer to use LPTz. LPTz allows you to print to a real or phantom
printer. You can use LPT2 and/or LPT3 even if they are not physic-
ally attached to your personal computer.

Another TSR you say!. Well LPTz allows YOU to specify how much
of your computers memory you want to use for LPTz. And LPTz allows
you to completely remove it from memory when you wish.

LPTz is feature-rich, flexible and friendly. LPTz will handle
most all your needs and if you change your mind, will adjust
to suit you and will let you know what it is supposed to be
doing, if you ask.

LPTz was 'born' out of the need to provide a stable print re-
director product (most available , public domain and Shareware
are feature poor or very unstable (read 'buggy')). The 'parents'
of LPTz were many. Various articles and source listing from other
TSR type products (that delve into the mysteries of DOS). Thanks
to the many other 'lites burning bright' that brought about LPTzs
successfully 'birth' and growth.

BOY, LPTz sounds great!. LPTz tries to be, BUT ("i knew you would
say 'BUT'".) even LPTz cannot be all things to all people. LPTz
has a few short-comings and we will discuss them later.

- 1 -

How do I get LPTz to work for me?

Glad you asked.

As with most things you do on a computer, you either type
in a command or click (mouse assumed) on an object in one
of the popular GUIs (pronounced 'gooies') that are the rage now-

With LPTz you have to type the command/letters/words as defined

Command syntax : (No, not a 'tax' on a vice, yet.)

LPTz [-x -y -z...]

the little '[]' are NOT part of the 'sintax' but only indicate
that all or none of the 'options' (see following pages) may be
specified at any one time. The little "..." means i got tired of
entering the '-letters' and will let you pick a few more, as there
are quite a few. The '-x'/'-y' mean that there are various options
to choose from but they MUST be preceded by a '-'. The options are
defined in the following pages (no peeking ahead).

For LPTz to function in its simplest form, all that is required
for you is to LPTz the printer that you want redirected and the
file name that you want the redirected print data written to.

For example, you could type:

LPTz -p1 Output4.pr1

this would capture most all DOS printer output directed to
LPT1 and send it to a disk file called 'Output4.pr1'.

- 2 -

OK, so what are all the little '-' options mentioned.

Here goes..

Option Option definition
------ ---------------------------------------------------
-? LPTz will display a 'help' screen of all its options.
NO other options, if any entered with '-?', will
be processed (they are ignored).

? SEE '-?' option above

-Px The -P option is used to specify the printer,
LPT1/LPT2/LPT3, that you want redirected.

Obviously the 'x' is 1 or 2 or 3. Neat how this
works. Some, but not all the options, require
that a printer be specified, for them to work.

ONLY one printer can be specified per
invocation (word for the day) of LPTz, BUT
all 3 printers can be specifed, but you must
execute LPTz 3 separate times. Hopefully the
next version will remove this restriction.

file name The filename is the name of the file that the
printer output, that LPTz captures, is to be
written to. A fully qualified DOS drive and
path name qualifier is supported.

A 'special' format of a filename can be defined
to allow automatic generation of unique filenames.
This allows each file written to a redirected printer
to be catalogued separately. (see '-F' option)

-A The -A (append) options says to 'add' the redirect-
ed printer data to an existing file or create a new
file with 'file name' specified and add to it.

Internally to LPTz, when a buffer fills , forcing
LPTz to flush (write) the buffer, the 'file name'
specified is opened , the buffer written and the
file immediately closed. This insures that DOS
always knows about the true length of the file.
This means that the most data that can be lost
is the part that is in the buffer and not yet written,
perhaps due to power loss ..etc.

- 3 -

Option Option definition
------ ---------------------------------------------------

-O The -O (overwrite) options says to 'create' and even
overwrite an existing file (you lose data that was in
the existing file).

Internally to LPTz, when a buffer fills , forcing
LPTz to flush (write) the buffer, the 'file name'
specified is opened , BUT never closed until you either
force a close ('-c'), remove LPTz from memory ('-u'),
a 'file' flush occurs or error writing file occurs.

The 'bad/good' thing about using the the '-o' is that
DOS does not know about the length of the file until its
closed. In other words it has a '0' length until closed.
You can write thousands of bytes of data to the file
but DOS and other programs will think that there is
nothing in the file , until you want them to.

A word of warning, DON'T run any utilities that sort
the DOS directory (Norton DS) or compress the disk
while LPTz is loaded, as you will wind up with lost
clusters if you run CHKDSK or LPTz will cease to function

-C The -C (Close) option causes LPTz to flush all buffers

for a specific printer and to stop redirecting printer
data. After '-C' option executed, any data directed to
a printer will start printing to a real printer, if its

-Bxx The -B option allows you to specify the size of the
buffers to be allocated to all 3 printers. The buffer
sizes allowed are from 4 to 64k, where 'k' means
1024 bytes times the number specified as 'xx'. The
default is 4k, enough for a print-screen.

The buffer size MUST be specified the FIRST time LPTz
is invoked, else the default 4k is used, from then on.

The plans are for the next version to allow you to
specify a buffer size for EACH printer and ONLY
use memory for the buffers when actually needed.

In otherwords, dynamically allocated buffers.

Obviously, the smaller the buffer size the more work
LPTz has to do in writing filled buffers to disk.
The larger the buffer size, the less memory you have
available for other programs.

- 4 -

Option Option definition
------ ---------------------------------------------------

-Fxxx The -F option allows you to specify that a flush of
any partly filled buffers, for a specific printer,
be automatically written. The automatic flush occurs
after 'xxx' number of seconds have elapsed and nothing
new has been written to the buffer.

This insures that there will be very little chance of
data loss, in case of loss of power or PC re-booted.

There was a requirement, on a network, to redirect
printer output to a disk file on a server. The disk was
a 'virtual' disk on a VAX computer. The output was
redirected to a 'special' DOS filename. A program
running on the VAX server would 'look' for a file with
a specific extension and 'copy' it to its own real
disks for further processing.

When LPTz is used with the '-F' option and printer output
is redirected to a 'special' name, a certain sequence of
events occurs.

First, when you invoke LPTz you MUST specify that auto-
buffer flushing is to occur. Specify the number of seconds
from 5 to 300. Specifying a value of zero(0) seconds
disables auto-buffer flush if it is activated. You can
reactive it later by specifying another non-zero value.

Secondly, you MUST specify that printer redirection be
written to a file name of the following format:

1). the filename MUST NOT have an extension

2). the FIRST THREE characters of the filename
must be numeric.

This is the events that will occur:

1). all print data will be redirected to 'special'

2). after 'xxx' number of seconds have elapsed and
nothing has been written to file (given that
something has been, at least once), the buffers
for the specific printer is flushed. Next the
file is renamed and a new file with the same name
that LPTz was invoked with is reopened as empty.

Forcing a file/buffer close with '-C' option ,
de-installing LPTz or disk error also causes
the above event to occur.

- 5 -

Option Option definition
------ ---------------------------------------------------

-Fxxx You are not sure how this works? OK, lets take an

You invoke LPTz : LPTZ -p1 -f30 000-lpt1

this says, redirect LPT1 to a disk file called
'000-lpt1' and perform automatic buffer flush
every 30 seconds.

Then , given that something has been written to
the file, when the 30 seconds elapses:

1). the buffers are flushed to '000-lpt1'

2). a file called '001-lpt1.txt' is deleted, if
it exists.

3). the file '000-lpt1' is renamed to '001-lpt1.txt'

4). a new internal next-filename of '002-lpt1.txt'
is generated, if needed the next time.

4). a new file called '000-lpt1' is open/created and
all future printer redirected data is written
to it until the flush timeout limit again occurs.

A few notes/insights are necessary here.

With auto-file flush its best to start off with '000'
and let LPTz internally increment the file name number.
When LPTz gets to '999' internally, it starts back with
'001'. So, you see that '000' is a safe filename number
to start off with. However, to provide maximum flexibility
you can start off with any 3-digit filename BUT only '000'
is protected from being over written. The next release will
protect the original filename and insure that other
redirected filenames (for other printers) are not duplicat-

- 6 -

Option Option definition
------ ---------------------------------------------------

-M The -M option toggles the state of the mode that the popup
window is displayedn. If monochrome-mode not active then
the popup window will display in color, else the popup
window will be black-and-white. Invoking LPTz with this
option toggles the state, if off it will be turned on else
if on it will be turned off.

-L The -L option toggles the state of Line-feed stripping.
With this option active all line-feed characters are
stripped before being written to redirect disk file.

-S The -L option toggles the state of some internal beeps
and honks that can be turned on. If sound option on
then every time a buffer fills you will hear a couple
of short beeps. This is some indication that your buffer
sizes are too small, if you hear alot of beeps often.
Disk error will generate a bunch of beeps and honks
reguardless of this options setting.

-U The -U (last but not least) allows you to completely
remove LPTz from you computers memory.

LPTz will be removed, given that NO other TSRs or
programs have changed the interrupt vectors that LPTz
used when it started.

All redirected disk files are closed, after buffers
flushed, and all memory allocated to buffers is returned
to DOS.

Then all interrupt vectors are returned to the state
that LPTz was aware of when it was initially invoked.

- 7 -

Whew! That's alot of verbiage to absorb, the first time thru.

Its not as confusing as it may appear. We just want to document
all the in-and-outs, so can use LPTz to the max.

Again, LPTz can't be all things to all people (or DOS). LPTz tries
to do things in the background, while your applications are running
in the foreground. Given that DOS was not really designed to support
this, in all cases, LPTz can't redirect all printer requests.

Specifically, the DOS 'TYPE' and DOS 'COPY' commands to a LPT will
'abort' if LPTzs buffers are not large enough to handle the total
typed/copied file. In otherwords, if the file is bigger than the
buffer LPTz has allocated to the printer, then LPTz will return
a 'timeout' to DOS when the buffer fills and you will most likely
see an 'abort, retry or ignore' message.

LPTz will ONLY capture data that goes thru the BIOS interrupt 17.
Any application that writes directly to the hardware cannot/will not
be redirected.

LPTz intercepts DOS interrupt 21, specifically function calls:

5 - write a character to standard printer

40 - write character(s) to a file. If the file is the
standard printer file, file handle 0004, its output
is redirected thru LPTzs interrupt 17 handler.

44 - IOCTL call 3, write to character device. Again, if the
file handle is 0004, for standard printer, the output
is redirected thru LPTzs interrupt 17 handler.

DOS interrupt 21 is intercepted for these function calls
to allow LPTz to gracefully handle buffer fills.

LPTz primarily intercepts the BIOS interrupt 17. This allows it to
buffer data for the redirected printers.

seen NO other product (Public domain or Shareware) that CAN handle it.

LPTz goes to GREAT lengths to see that all your precious print data
is safely handled!!

We have lots of ideas for future enhancements to LPTz, as it grows
and matures. We are not restricting access to LPtzs functions in
version 1.00. However, if usage appears high and registrations low,
then we will be forced to restrict options available ,thru Shareware,
in future releases. Also, the source is not available but if you
are scared of viruses, then use the registration form to get a copy
save directly from the author.

- 8 -

What's this 'popup' window that was mentioned earlier.

Boy, nothing gets by you!

Basically, LPTz provides the feature to allow you to pop-up
a window. This window allows you to turn printer redirection
on and off while in the middle of another application.

However, to turn it on, you must have first redirected a
printer to a filename. This only makes sense.

LPTz will only pop-up if you are in a text mode application.
If you are in graphics mode application, then you would have
to leave it to change LPTz. Perhaps we can handle this is a
future release. A mouse is not supported, but could and may
very well be in one of the next couple of releases.

To get the pop-up window onto the screen you press:

either -

ALT-Print Screen

ALT-* (on keyboards with separate cursor keys)

Pressing either :



will remove the pop-up window from the screen.

We are toying with the idea of letting you dynamically change the
pop-up windows location. What do you think?

- 9 -

I have specified all these options to LPTz, how do i know what
LPTz is doing.


Just type:


LPTz will tell you every thing you didn't want to know about what
it is doing or again you may.

If you have the buffer flush option active (see '-F') and data is
in the buffers, LPTz will tell you when the next buffer/file flush
for each printer is due. How friendly can you get.

Another idea we are tossing around is to allow other programs to
access LPTz thru API calls (only programmers may understand what
we mean here). This would allow other applications to 'talk' to
LPTz directly from an application and to query its state or to
dynamically modify LPTzs processing state.

Now for a few odds-n-ends we missed.

Any error writing the buffers immediately disables printer re-
direction for a specific printer. If you correct the error, you
can turn it back on later, with out re-loading LPTz. You will hear
a bunch of beeps and honks if an disk error occurs, such as disk full,
removing disk from drive, you deleted LPTz file it was using (naughty),
or you ran CHKDSK or disk compress.

Oh, PC-Write requires you to gererate a 'pr.def' file and to specify
that its print output go to a LPT device, for LPTz to work with
PC-Write. Contact PC-Writes technical support if you need help with
their product.

- 10 -

Appendix A - Program Messages.

All message text is preceded by a formatted message code.

The format of the message code is:


where :

NNN= 000 thru 999, which is the message number for this
message type.


y= 'D' - for Diagnostic type messages. These messages are
normally printed only if a critical error occurs
or the program is in a 'test' or debugging mode.

'E' - for Error messages. These type messages indicate
that an unrecoverable error occurred and the program
could or could not take any corrective action.

'I' - for Informative messages. These messages are just
to inform you as to the processing state of the
program at any given time.

'W' - for Warning messages. These messages indicate
that an error occurred, but that the program
was able to take corrective action and continue
processing. However, the function the program was
attempting may or may not have been successfully

'P' - a message is displayed that requires you to reply
to the program, normally via the keyboard.

- A1 -

Appendix A - Program Messages.

The messages that LPTz generates are not documented

in this release.

(as they are mostly self-explanatory)

- A2 -

Appendix B - Site License


Corporate users may wish to obtain a site license for the use of LPTz.
The site license applies only to one geographical area, not to exceed
a 50 mile radius. Additional site licenses are required for each
unique geographical location.

Please use the order form in this manual to request a site license.

Site licenses are now negotiated on an individual basis. License fees
vary depending on the number of computers on which LPTz will be used.

LPTz is ONLY licensed per single unit quantities of,

1 single unit license - $20 each ($10 upgrade fee each)

A site license may be requested and will be negotiated on an
individual basis.

The following page is a license agreement, which should be signed
and sent with your payment when ordering a commercial license.

- B1 -

Commercial License Agreement

The use of LPTz in a commercial environment or government organization
is granted under the following terms:

1. Payment of the license fee must be made payable to
: James P. Morgan

The fee is based on the number of computers which will be used
to run LPTz , as follows:

LPTz is ONLY licensed per single unit quantities of,

1 single unit license - $20 each ($10 upgrade fee each)

2. You may use LPTz on the number of computers included in the license
fee. If you have negotiated a site license, then you may use LPTz
on any number of computers within your organization, within a given
geographical area.

3. You may make copies of the program and documentation, in their
original, unmodified form. You may distribute these copies, within
the limits of the number of copies licensed.

4. You may use all future Shareware versions of LPTz under this license.

5. You may NOT modify the program or charge a fee for copying or
distributing the program or its documentation.

6. It is your responsibility to make the necessary copies and to
deliver them to the computers which they will be used on.

7. We are not responsible for anything that may happen or not happen
if you use LPTz.

8. You are required to complete and sign this form and the ORDER form
, and return them to James P. Morgan

I agree to abide by the terms and conditions of this license.

_____________________________ __________________________
Signature Date

Name (please print or type)



- B2 -

Appendix C - Ordering


Check which items you wish to purchase:

(_) Noncommercial license for the use of LPTz.

(_) Commercial license for the use of LPTz on ___ computers

(_) Program update fee of $10.00 for each of __ computers that LPTz
is currently licensed on.

(_) Update media is : (_) 5-1/4 floppy | (_) 3-1/2 micro floppy

(_) Payment of $_____ is enclosed (check or money order),
+------> payable to : James P. Morgan

Signature: ________________________________




______________________ ________ ____________
City State Zip


*** Send check or money orders payable to : James P. Morgan ***
(all other endorsements will be returned and order not processed)

Send this completed form to:

James P. Morgan
5226 Via Hacienda Cr #115
Orlando FL 32809

- C1 -

For program disk orders outside the U.S., please add an additional $5,
and enclose a check or money order payable in U.S. currency and
drawn on a U.S. bank. Any checks/money orders that cannot be deposited
in a U.S. bank WILL be returned without processing of the order.

For commercial license orders, please enclose a signed copy of the
the license agreement.

Inquires for Corporate wide unlimited usage licenses are welcome.

- C2 -

Appendix D - Comments


If you have found any errors in this documentation that you would like
to bring to our attention, please indicate them below. Please indicate
them by page number if possible. If there are other improvements to the
documentation, product features that you would like us to consider,
or any ways you are using LPTz that you would like to share, please
indicate them here:
























- D1 -

Appendix E - Mailing


Please let us know when you change your address, so that we can keep
you informed of product improvements, etc.

NAME: ______________________________________________________________________


SERIAL NUMBER:______________________________________________________________

Old Address:





New Address:






Effective Date of New Address:______________________________________________


James P. Morgan
5226 Via Hacienda Cr #115
Orlando FL, 32809

- E1 -

 December 8, 2017  Add comments

 Leave a Reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>