Windows 7 Command Line – How to Copy a Print File to a Networked Printer

command lineipprintingwindows 7

I have an Epson TM-T88V network printer. I can print to it using the printer driver. But I need to copy a "print file" to the printer using the command line, and this causes problems.

I cannot use

copy file.prn {ip-address}

Because this will simply copy the file to a new file with the name of the ip address.

I have seen various suggestions… that do not seem to work:

copy file.prn \\{ip-address}

The specified path is invalid

This one too failed me:

NET USE LPT1: \\{ip-address}\{printer-name}

System error 66 has occurred.

The network resource type is not correct.

Trying to ftp the file over failed, too. (Could not open a connection.)

Any ideas how to go about this?

Best Answer

Use Microsoft's lpr client

C:\>lpr /?

Sends a print job to a network printer

Usage: lpr -S server -P printer [-C class] [-J job] [-o option] [-x] [-d] filename

Options:
     -S server    Name or ipaddress of the host providing lpd service
     -P printer   Name of the print queue
     -C class     Job classification for use on the burst page
     -J job       Job name to print on the burst page
     -o option    Indicates type of the file (by default assumes a text file)
                  Use "-o l" for binary (e.g. postscript) files
     -x           Compatibility with SunOS 4.1.x and prior
     -d           Send data file first

This works with JetDirect and similar boxes/adapters as well as Unix/Linux and Windows servers that have the LPD service enabled.

Related Question