How to print from a DOS-command prompt (console prompt) to a Network Printer

In some business sectors, it is common practice to send printer file or plotter files from one office to
another office (via email, CDR, ftp, etc). All you need to do is dump the printer file or plotter file to
the printer port. If a printer is directly connected to the PC's LPT1 port , printing is done by popping
a command (or cmd) console (a black screen) and type
copy  binary.prn  lpt1 
or  copy /b binary.bin lpt1

To generate a printer file so that it can be sent to remote locations (via email, CDR, ftp):
Click File...Print...select the correct printer type... then select "Print to File"


The following steps show how to dump a printer file or plotter file to a network printer.
Choose either the peer-to-peer mode or the client-server mode

g

Client-server mode is easier, but it needs a server, or a dedicated PC,
or simply treat your own desktop PC as the "server" for this purpose.

Peer-to-Peer mode:
Get netcat (extract nc.exe using winzip) from http://netcat.sourceforge.net/
from here
Windows NT/2000:  extract nc.exe to c:\winnt
Windows XP: extract nc.exe to c:\windows

On the Client PC:
Pop up a command console screen:
g Windows NT/2000/XP: Start...Run...cmd
nc  192.168.1.252  9100  <  drawing.bin

and when the file is sent, press ctrl-C to end the job.

Here is a PDF manual of netcat (Unix version of netcat), unfortunately the Windows version
of netcat does not implement the -q option. That means you may have to guess
when the file is completely sent, and then hit Ctrl-C at the end.

Ottho Cabrera of Mexico reported that using nc.exe with the -w 1 option works:
nc  -w 1 192.168.1.252  9100  <  drawing.bin
(This method works if the drawing.bin file is not very big, that it can fit in the printer's buffer memory)

Often, in a university environment, there are thousands of PostScript printers, many of the thesis
are posted in postscript format (e.g. thesis.ps), in that case, printing these thesis is easy:
nc ip_address_of _postscript_printer 9100 < thesis.ps


Client Server mode:
Assuming that the server has a name "myserver" (as seen by the Network Neighborhood browser),
connected to the network printer (using port 9100), and shared its printer, the shared printer name is "xerox".

On the "server", create a user with the same login name and password as the user on the Client PC.

On the Client PC:
Pop up a command console screen:
g Windows 2000/XP: Start...Run...cmd

Create a dummy port on the Client PC: (also known as port re-direct)
net  use LPT3:  \\myserver\xerox

copy   letter.txt   LPT3:
  or
copy  /b  myairplane.plt   LPT3:

(to delete the dummy port:    net use LTP3:  /delete  )

Here is a neat DOS-Windows trick:
(1) Create a batch file (e.g. something.bat) in the folder where you normally save the plot files or printer files.
(2) The content of the batch file looks something like this, edit to suit your own environment.
(3) Drag and drop the plot file or printer file into the batch file icon. This will send the plot file
or printer file to the network printer.

Disclaimer


© 2002-2006 Nicholas Fong, 

Burnaby, B.C., Canada g

Last revision date:  August 9, 2006