| Introduction: This article explains how to speed up | | | | If you're not a programmer, you can change the |
| printing from DOS to a DOS compatible printer on | | | | Windows 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 printer | | | | printing before the DOS program has really finished |
| which is not DOS compatible, like a Windows-Only | | | | creating the job. |
| (GDI) USB printer or a virtual printer (WinFax, PDF | | | | 1) 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" at | | | | The timeout value is stored into a Registry entry. |
| The Problem: If you run a DOS application on | | | | TAKE 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 are | | | | machine 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 may | | | | HKey_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 device | | | | Double clicking the value you can choose how many |
| 2. How the DOS program uses the CPU on the | | | | seconds you prefer, then reboot your machine to |
| machine | | | | apply the change. |
| 1) Managing the DOS printing device | | | | 2) If you're runnign an older Windows OS (9x/ME) |
| In the age of DOS, most of the printers were | | | | Search 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 data | | | | it 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 soon | | | | PrintBufTime=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 printing | | | | This will set the timeout to 10 seconds. Reboot your |
| device (port) when the print job ended, because the | | | | machine to apply the changes. |
| printer had already finished its job. | | | | 2) DOS CPU usage |
| Under Windows things are different. Laser and other | | | | Unlike Windows, MS-DOS was a single-user operating |
| graphical printers need to receive an entire page | | | | system. You could only run a single program at a time, |
| before rendering it on paper. Additionally, multiple | | | | which could even keep the entire CPU for itself, to |
| applications running/printing on the same machine | | | | work as fast as possible. |
| introduced the need for a printing queue, especially with | | | | This 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 port | | | | hogging. |
| at the print job end, then Windows does not know the | | | | Typically, when polling the keyboard (during a wait |
| job is really finished. It waits for a timeout value to | | | | state), 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 DOS | | | | any troubles at all, but on Windows, the system might |
| program as soon as it finishes printing. You'll see your | | | | be 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 the | | | | To check if your own DOS program is actually |
| DOS program, if you are the original programmer. In | | | | hogging the CPU, please try to leave the Task |
| other articles I show you how to do this with popular | | | | Manager opened while it's on execution. |
| DOS programming languages, like Basic: and Clipper: | | | | |