How to make DOS programs printing faster in Windows

Introduction: This article explains how to speed upIf you're not a programmer, you can change the
printing from DOS to a DOS compatible printer onWindows timer above, to make the delay shorter. Do
Windows.not set the value too low or the printer could start
If you need to print from DOS to a Windows printerprinting before the DOS program has really finished
which is not DOS compatible, like a Windows-Onlycreating the job.
(GDI) USB printer or a virtual printer (WinFax, PDF1) If you're running an NT based Windows system
writers, etc.), please see "How to print from DOS to(2000, XP, Vista)
Windows-Only printers" atThe timeout value is stored into a Registry entry.
The Problem: If you run a DOS application onTAKE CARE using RegEdit. It could be rather
NT-based Windows systems (Windows 2000, XP,dangerous. If you'll perform the wrong actions, your
2003, Vista), you may find that your print jobs aremachine could even refuse to reboot.
spooled after many seconds, sometimes minutes,In REGEDIT ( START -> RUN -> REGEDIT )click :
especially when printing to a network printer. It mayHKey_Local_Machinethen click : Systemthen click :
even happen on Windows 95/98/ME machines.CurrentControlSetthen click : Controlthen click :
The problem has two main causes:WOWhere you'll find the LPT_timeout property.
1. How the DOS program manages the printing deviceDouble clicking the value you can choose how many
2. How the DOS program uses the CPU on theseconds you prefer, then reboot your machine to
machineapply the change.
1) Managing the DOS printing device2) If you're runnign an older Windows OS (9x/ME)
In the age of DOS, most of the printers wereSearch your C drive for the SYSTEM.INI file and open
dot-matrix and connected to a parallel port (LPT1:,it with NOTEPAD (don't use Ms-Word or other word
LPT2: or LPT3:)processors)in the [386enh] section search [Network] if
A typical DOS program sends binary datait does not exist enter the following:
(characters) to one of these ports (usually LPT1:). A[Network]
dot matrix printer can start printing that data as soonPrintBufTime=10
as it's sent to the port and before all the data has[IFSMGR]
been sent by the program.PrintBufTime=10
A DOS programmer did not need to close the printingThis will set the timeout to 10 seconds. Reboot your
device (port) when the print job ended, because themachine to apply the changes.
printer had already finished its job.2) DOS CPU usage
Under Windows things are different. Laser and otherUnlike Windows, MS-DOS was a single-user operating
graphical printers need to receive an entire pagesystem. You could only run a single program at a time,
before rendering it on paper. Additionally, multiplewhich could even keep the entire CPU for itself, to
applications running/printing on the same machinework as fast as possible.
introduced the need for a printing queue, especially withThis causes a common problem for DOS programs
network printers.running on recent Windows machines: the CPU
So, if the DOS program does not close the printer porthogging.
at the print job end, then Windows does not know theTypically, when polling the keyboard (during a wait
job is really finished. It waits for a timeout value tostate), the DOS program performs an infinite loop, to
expire before deciding to finally spool the next job.check it as fast as possible. In DOS this did not cause
If you're in this situation, you can close the DOSany troubles at all, but on Windows, the system might
program as soon as it finishes printing. You'll see yourbe so "busy" that no other tasks can be performed
print job start immediately because all the DOS(including the print spooling process, which usually starts
handles will be closed by the Operating System itself,when the DOS program has finished printing and is
including the printer port.waiting for user input, typically on a menu).
The best solution for this problem should be to fix theTo check if your own DOS program is actually
DOS program, if you are the original programmer. Inhogging the CPU, please try to leave the Task
other articles I show you how to do this with popularManager opened while it's on execution.
DOS programming languages, like Basic: and Clipper: