Solved

Capture LPT1 port to a file in a DOS program

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

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

Suggested Solutions

Introduction: Recently, I got a requirement to zip all files individually with batch file script in Windows OS. I don't know much about scripting, but I searched Google and found a lot of examples and websites to complete my task. Finally, I was ab…
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
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…

863 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

27 Experts available now in Live!

Get 1:1 Help Now