Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Capture LPT1 port to a file in a DOS program

Posted on 2009-07-09
4
Medium Priority
?
687 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 2000 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

In this series, we will discuss common questions received as a database Solutions Engineer at Percona. In this role, we speak with a wide array of MySQL and MongoDB users responsible for both extremely large and complex environments to smaller singl…
One of the most important things in an application is the query performance. This article intends to give you good tips to improve the performance of your queries.
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…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …

636 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