Solved

Capture LPT1 port to a file in a DOS program

Posted on 2009-07-09
4
636 Views
Last Modified: 2013-12-04
We have an old DOS program that the database need to be exported.  The database is proprietary and cannot be access with out the application.

What we want is to export the clients to a file and are thinking a way to capture the LPT1 port (that's where is printing) and have it print to a file.

We considered MODE command but it seems insufficient.
0
Comment
Question by:rayluvs
  • 3
4 Comments
 
LVL 19

Accepted Solution

by:
deroode earned 500 total points
ID: 24814015
If this is a DOS program on a DOS machine you're in trouble...

If you're running this DOS program in windows proceed as following:

- Create a local printer with driver Generic / Text only (Manufacturer Generic), connect this printer to LPT1:

- Open the printer properties, tab Ports, Add new port
- Add a local port, give it the name of the file you want to print to, e.g. c:\temp\print.txt
- Check "Enable Printer Pooling"
- Make sure both the LPT1: port and the new c:\temp\print.txt port are checked.

Anything that is now printed to LPT1: lands as text in the print.txt file

Caution: Every new printjob will overwrite the old print.txt file. But it seems that this export is a one-time excercise

0
 

Author Comment

by:rayluvs
ID: 24814148
Ok...will do

(its a window Xp machine)
0
 

Author Comment

by:rayluvs
ID: 24816166
Thanx!

Worked
0
 

Author Comment

by:rayluvs
ID: 24816175
I also forgot the NET USE

net use lpt1: \\computername\printersharename /persistent:yes

All worked!!
0

Featured Post

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

APEX (Application Express) is used to develop a web application from Oracle. SQL Workshop is one of the tools that comes with Oracle APEX to query or modify the database objects or to make any changes to the structure.
This article explains all about SQL Server Piecemeal Restore with examples in step by step manner.
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question