Solved

Capture LPT1 port to a file in a DOS program

Posted on 2009-07-09
4
651 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

Entering a date in Microsoft Access can be tricky. A typo can cause month and day to be shuffled, entering the day only causes an error, as does entering, say, day 31 in June. This article shows how an inputmask supported by code can help the user a…
Azure Functions is a solution for easily running small pieces of code, or "functions," in the cloud. This article shows how to create one of these functions to write directly to Azure Table Storage.
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…

739 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