How to perform LPR printing from W2K Pro cmd line?

J

John B

I have a print server with address of 192.168.30.81 on my INTRANET. I can
print OK from Windows applications, and by sending a "test page" from the
usual Windows "printer" icons in Control Panel.
I have installed Print Servcies for Unix, and am currently using an LPR
device, under Control Panel, as my default printer. Fine with that.

I want to use command line printing, using the "lpr" command. Can't seem to
make it happen. Any advice appreciated.

Typically, I'll type the following at my cmd line, without success. All I
get back at the console is a "help screen" pertinent to the switches
available under the lpr command. "File.txt" IS indeed present in the
default directory, so I am not referring to a non-existent file.



lpr -S 192.168.30.81 file.txt

It doesn't help to put the "-d" switch in front of "file.txt."

Thanks for any help.




Here printed is some data from my cmd window:




Pinging 192.168.30.81 with 32 bytes of data:

Reply from 192.168.30.81: bytes=32 time<10ms TTL=32

Reply from 192.168.30.81: bytes=32 time<10ms TTL=32

Reply from 192.168.30.81: bytes=32 time<10ms TTL=32

Reply from 192.168.30.81: bytes=32 time<10ms TTL=32

Ping statistics for 192.168.30.81:

Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),

Approximate round trip times in milli-seconds:

Minimum = 0ms, Maximum = 0ms, Average = 0ms



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
 
A

Alan Morris [MSFT]

you need to specify the -P option
this is the printer. Normally I use the print share since I don't have to
" " the share as long as there are no blank spaces in the share name. If
you are sharing the printer with spaces in the name you will need the "".


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



--
Alan Morris
Windows Printing Team
Search the Microsoft Knowledge Base here:
http://support.microsoft.com/search/?adv=1

This posting is provided "AS IS" with no warranties, and confers no rights.
 
J

John B

Thank you. I didn't realize that I had to share the printer object.
Both of the following command lines worked, exactly the same:
lpr -S 192.168.30.81 -P \\LPRNEC file.txt
lpr -S 192.168.30.81 -P LPRNEC file.txt

So there is no way to stipulate the "print queue" argument without using the
Microsoft share method?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top