Solved

Capture LPT1 port to a file in a DOS program

Posted on 2009-07-09
4
602 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

CCModeler offers a way to enter basic information like entities, attributes and relationships and export them as yEd or erviz diagram. It also can import existing Access or SQL Server tables with relationships.
Many companies are looking to get out of the datacenter business and to services like Microsoft Azure to provide Infrastructure as a Service (IaaS) solutions for legacy client server workloads, rather than continuing to make capital investments in h…
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…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…

707 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now