Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question
up vote 2 down vote accepted

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.

share|improve this answer
    
lpr did the trick! Mind you, I had to do do gymnastics to get it to work on a 64-bit Windows installation. superuser.com/a/420410/2565 – Ola Eldøy May 4 '12 at 7:31

From the command prompt:

copy filename \\Server Name\\{Printer Share Name}

If there is a space with the print share name be sure to enclose in quotes. For example:

copy filename "\\{Server Name}\\{Printer Share Name}"
share|improve this answer

Try sharing the local printer connection and then connect it to LPT1

NET USE LPT1: \\localhost\printer
share|improve this answer
    
Thanks, I tried it. The net use command was successful. However, trying to copy it afterwards failed. ('copy file to lpt1' gave 'access is denied', and 'copy file to lpt1:' gave '"lpt1:" is not a recognized device. The system cannot find the file specified.') – Ola Eldøy May 4 '12 at 7:06
1  
If you use /persistent:yes it will keep the connection after a reboot NET USE LPT1: \\localhost\printer /persistent:yes – user508984 Oct 13 '15 at 18:14

Just share the folder c:\windows\system32\spool\printers in which the shared printer is connected for everyone with full control both in share and security menu. That will work fine.

share|improve this answer
    
Welcome to Super User! Please read the question again carefully. Your answer does not answer the original question. – DavidPostill Jul 24 at 17:18

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .