Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Printing to DOS with a broken LPT1 Port 1

Status
Not open for further replies.

niallo32

IS-IT--Management
Apr 29, 2004
404
IE
I use a payroll application called Pascal (DOS) which only prints to the LPT1 Port on a Windows 2000 Workstation. The LPT1 port is damaged on my pc and I need to capture DOS to print to a network Printer.

The Printer is an Oki393c attached to a Jet Direct Card with an IP Address of 10.0.2.20.

I created a batch file called 'Printer.bat' and put it in the Startup folder of All Users, with the following text in it: net use lpt1 \\Servername\Sharename

I tried printing and it still doesnt work - any ideas
 
If the LPT1 port is still activated deactivate it in you
bios, or if it's a card, remove it then reboot and try it.
 
Try a google search for "print to file". There is one on the web somewhere. Just don't know where it was.

Ed Fair
Give the wrong symptoms, get the wrong solutions.
 
EdFair was taking about a program named PrintFile from Lerup which monitors a directory you specify and whenever a file (a print job) is placed there it forwards the job to the printer.

Is the printer with JetDirect connected to a print server? If so then you could run this in a DOS window:

NET USE LPT1 \\{PrintServerName}\{PrinterNameOrIP}

To close the redirection:

NET USE LPT1 /DELETE

Also: thread182-155776, thread182-866061, thread290-881855

dbMark
 
There is one for redirecting lpt data to a file. Did a google search and found several on the first couple of pages. Unfortunately I didn't see the free one.

Ed Fair
Give the wrong symptoms, get the wrong solutions.
 
Thanks for the reply guys - I was out of the office for the last few days.

I've deactivated the LPT1 Port in Device Manager.

From Start/Run \\Servername\Printername calls up the Printer Window of the Printer I want to print to, but when I issue the NET USE LPT1 \\Servername\Printername command from DOS, I get the following error:

System Error 85 has occured.
The Local Device Name is already in use

Any ideas?

Thanks
 
You do not have to deactivate LPT1 in Device Manager. What NET USE does is redirect data headed for that port to another destination, in this case the network printer.
 
Oh, DOS is older technology and so handling things in Windows is a bit awkward. Don't forget that in Windows NET USE does not allow you to connect directly to a JetDirect-connected printer. The printer driver must be installed on a computer or server somewhere and have sharing enabled with a share name. (Start, Settings, Printers, Add Printer, etc.) Then NET USE can connect you to the shared printer.

NET USE LPT1 \\{ComputerOrServerName}\{PrinterShareName}
 
I have the Printer setup as a Network Printer and issue the NET USE LPT1 \\{ComputerOrServerName}\{PrinterShareName} command from a DOS Prompt/Batch File etc but I still get the error 'System Error 85 has occured.
The Local Device Name is already in use'.

I have reactivated LPT1 in Device Manager.

Any ideas?

Thanks
 
Did you issue this first to ensure any current connection was removed?

NET USE LPT1 /DELETE

If your version of Windows wants you to confirm the deletion, then you can add the /YES parameter.

NET USE LPT1 /DELETE /YES

If you are doing this in a program, you may want to send any resulting message to la-la-land so your screen isn't needlessly cluttered with messages.

NET USE LPT1 /DELETE > NUL

Possibly you can specify either LPT1 or LPT1: with the colon added, since for me it worked either way. Look at all the NET USE options:

NET USE /?
 
Thanks a lot DBMark - the NET USE DELETE Command seemed to be the problem, and when I put a Semi Colon after LPT1 it printed fine. Much appreciated!
 
Due to the underlining it may have looked like a semicolon ";" but it was really a colon ":" as in "LPT1:"

In any case it does seem to be optional.
 
Just my 2 cents, but I had a similar situation that was resolved when I first "added" the printer as a local printer directly connected (just removed the plug and play option and install the drivers)to lpt1. Then the net use command redirected to the networked printer and I was able to print.

 
Thanks for the suggestion - I'll look into it.

Cheers
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top