|
What if your DOS program cannot print to the file:
There are 2 steps ...
The exact steps will very depending on what operating system you are using. The principles involved are explained here.
1. Create a new printer which prints to a file
Go to the "Add Printers" page
Add a "Generic Printer"
Go to the Properties of that printer, and change the "Port" so that it prints to a file
You can choose the "Print to File" port, and the system will ask you the filename each time, or you can create a new port with a name like "c:.txt"
Right click again on the printer icon. Click Sharing on the menu. Then click on "Shared as". Enter a network name for the printer, something like "TextPrn".
2. Capture lpt1: (or lpt2:) output and redirect it to that printer
You need to have TCP/IP networking installed. If your computer connects to the internet, then you will have it already installed. If not, click Here for instructions
Enter command prompt (run command.com) and type:
NET USE LPT1: \MyPcName
MyPcName is your network computer name. Later, you can insert this line in a batch file, just before calling your program. This will only work if your PC is connected to a network (including dialup). If you have a stand-alone PC, follow these instructions.
Note that if your printer can accept text stream type input, you may only need to capture the port like this and redirect it to your printer - you may not need DOS Printer at all! The problem is that most modern printers need a wmf (windows metafile) as their input, and they will not accept simple DOS text.
3. You can print from your DOS Program now !
Your printing will be directed to the file you specified. Set DOS Printer to monitor for that file and you should be ok !
|