• Please review our updated Terms and Rules here

Printing to a network printer via DOS, is it possible?

Compgeke

Veteran Member
Joined
Sep 30, 2011
Messages
780
Location
Fairfield, CA, USA
I'm just curious to know if there's a way to print to a network printer through DOS. After googling I find nothing but people trying to do it for DOS programs on Windows, however nothing for DOS directly to a network printer.

The printer is a Laserjet 4000, which accept Plain Text, PCL and Post Script, so if there's a way to map the parallel port to the network that would work for just text only, however I can't seem to find anything to do so.
 
As pure "DOS" has no networking capability you need DOS pless a nework package. You also need to have the printer attached to a host. Then assuming you have the Microsoft Clinet for Windoes printing to a printer is fairly straight forward.

Share the printer with a name DOS understands, say LJ4000 and then assuming the host is "Winpc" do:-

net use lpt1 \\winpc\lj4000

hope this helps.
 
First, you need to establish if "the network" is going to be NetBIOS over NetBEUI, or NetBIOS over TCP/IP, or Novel/IPX, etc.

And we are assuming your network is ethernet. DOS could also do Token Ring and ARCnet with the appropiate network cards.

But yeah, it can be done. Do you have a network card for your DOS machine?
 
Yes, it can be done. I have demonstrated it using mTCP Netcat which is using TCP/IP.

The short story is that there are about three different printing methods over TCP/IP. There is LPR, IPP, and HP JetDirect. It is just a matter of connecting to the right port on the printer and shoving the right bits at it.

My printer (a recent Brother network printer) does PCL, Postscript, and good old Epson MX emulation. To print from DOS I used Netcat and had it connect on port 9100, which is the HP JetDirect port. The printer takes a raw data stream on that port and figures out what to do based on the data it receives. If your printer is listening for connections on port 9100 then there is a good chance that it will work for you. (Assuming you send it a reasonable data stream. Don't send Postscript to a PCL printer.)

I have not done a proper LPR print client yet - there is not a lot of demand for it. The protocol is a little more complex but every network printer probably understands it.

For background there is a discussion thread on FreeDOS here: http://freedos.10956.n7.nabble.com/Setting-up-a-shared-printer-tt8795.html#none

And a small writeup in their wiki here: http://sourceforge.net/apps/mediawiki/freedos/index.php?title=Netcat


Mike
 
The big issue is how the DOS program that you're using interfaces to the printer. If it's a direct write-to-port interface (as you might find in old WordStar), that's not going to be practical unless you use a gizmo that attaches to the parallel (or serial) port on the client system.

A fairly routine setup in the bad old DOS days was an auto T-switch that hooked to the printer and several PCs. There were also parallel link line extenders (converted the parallel signals to serial and used current-loop to cover long distances). I used the former quite a bit when a laser printer would set you back a couple of thousand. The T-switch would connect when any system would begin printing and then keep the connection for a time after printing ceased. In the meantime, it would return a "not ready" status to the other PCs.

They came in both serial and parallel flavors. I'm not sure which one this is, but at least you know what one looks like now.

Apparently short-haul parallel modems are still available. You could situate your printer almost a mile away from your PC if you had wire enough.
 
Last edited:
Many programs allowed for printing to a file. Dumping to a file first and then moving it (either as a file on media or as bytes over a network connection) allows for lots of possibilities.

I have an old TSR in the collection that redirected LPT output to a file. That trick won't work if a program does the port I/O directly, but I suspect that most programs did not do that because it would make them incompatible with the DOS print spooler. (And the other print spoolers that 3rd parties shipped too.)



Mike
 
Currently the Laserjet is hooked up via a Jet Direct card, so port 9100 is where I would need to force stuff for print jobs.

I'll play around with netcat later today. The problem with running a cable is the computer is in my room, the printer is in the living room so I would need about 40 feet of cable, which could be done, but it would be a bit of a pain for using one system.
 
If you want to print from DOS to a printer using the network, they have to be both connected to the network somehow ...

(I presume the cabling problem existed before your post.)
 
The 486 and the printer are both networked, however the network cable is thin enough to run under my bedroom door and to the living room to the printer, while the 486 is just networked from the switch on my desk.

I'm not seriously worried about printing though, as I rarely print anything to start with, I was just curious to know if there was an easy way of doing so.
 
Yes, it can be done. I have demonstrated it using mTCP Netcat which is using TCP/IP...
I have not done a proper LPR print client yet - there is not a lot of demand for it. The protocol is a little more complex but every network printer probably understands it.

*Raises hand in support of said feature*

Actually, I remember asking you about whether mTCP could safely be used in a TSR which hooks the parallel port IRQ and/or BIOS services, and you said "not without a lot of work". I think the best one can do until mTCP is TSR-safe (assuming there is demand) is make a small application analogous to the DOS PRINT command, keeping a queue and sending data at regular intervals.
 
Back
Top