Discussion Locked

Redirecting lpt1 to a file

0 helpful
5 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.
I have some old batch files that used netware to redirect print output from DOS apps to files. The problem is we will be going to NT and I don't know how to accomplish the equivalent of (capture create=path\filename) I'm really stuck on this one.I see that a network printer can be setup to print to a file that can be static or dynamic that's great but it doesn't solve my problem completely. The batch file runs unattended so if I were to use the dynamic option I'd need a way to fill in the text box popup. I was hoping that this could be done from the command line using NET USE LPT1: \\MACHINE\SHARE\FILENAME but that doesn't see to work. Any help you can provide me would be greatly appreciated.

5 replies

by nettek

I hope this is what you're looking for.

Windows allows you to create an "imaginary" printer. Go to the Printers folder and select Add Printer. You can choose "Local printer" because you still can direct the output to your network. When you are asked to select a port, check the box next to File - print to file. Move on to select the printer. Select "Generic" under "Manufacturer", then select "Generic / Text only" on the right. Name the printer (fileprinter, for example). Finish the installation.

Now you can capture LPT1 to "trick" the DOS application. c:\net use lpt1 \\localpcname\fileprinter.

Now if you select the print option in the DOS app, a window should appear where you can enter the path and file name of where you want the print output to go. \\servername\sharename\file.txt for example.

This process works for Win9x as well as NT.

by Member 29279078

Thank you but I was aware of that procedure. Since this is an unatended batch file if there were a way to specify the file name as a parameter or in advance of the popup I could use it.

by ramy naguib

On WIN NT install the printer driver .
Choose properties-ports -file ,and then configure the file (path and name)
You can install another copy of the driver with another name to let the users print directly on the printer.
Have a nice day
Ramy Naguib

This discussion is closed to new replies.