Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
We are using MS DOS programs on our computers. The programs work fine the problem is that our printer HPJ4200 is no longer on a lpt port it is using a Ethernet card and not connected through a port on the server (windows 2003 server). I know the old command net use lptx to print from DOS. The problem now this command no longer works and I can't find a command that will direct the DOS program to print from DOS. Does anyone know how to get the DOS program to print through a TCP/IP configured program? All the help would be great.

When you add the printer, select only the "Local printer attached to this computer option." Leave the other two boxes unchecked and click Next. Check the "Create a new port" box and use the drop-down to select "Standard TCP/IP Port." On the following screen, you need to furnish the IP address of the printer. After that, select your printer and continue until completion.
The following steps will allow your DOS apps to print from the printer.
Go to Printers and Faxes and right click the printer. Select Sharing and then enable sharing, and provide a name for the shared printer or accept the default name (remember what you named it -- you'll need it in the next step).
Open a command prompt (a "DOS" window) and type:
net use lpt1: \\computername\printername /persistent:yes
That command captures the print jobs sent to LPT1 by your DOS app, and redirects it to the printer. The "persistent" switch means that the command will load automatically everytime your PC starts.
To "undo" the command, at a command prompt just type:
net use lpt1: /delete
I hope that helps. Good luck, and please let me know if you need clarification.

I should have said to substitute your computer name and shared printer name in the net use command:
net use lpt1: \\computername\printername /persistent:yes

I don't know about the original poster but the above suggestion worked for me. Thanks.
There was one glitch I kept hitting though: my computer name has a period in it: compname.xxx (I don't know if this is standard).
If I included the .xxx in the command it would not work (System error 66 - what is this some Star Wars joke? :p). If I excluded the .xxx it worked just fine.

I tried 'net use lpt' trick with my DOS application but our Lexmark prints garbage instead of the documents.
Then I tested DOSPRN tools as suggested by tech guy and it printed my reports more or less reasonably.

![]() |
MS .NET Problems?
|
delete files at startup
|

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |