Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Want to send text file to a printer address 1

Status
Not open for further replies.

Mabjro

Programmer
Jun 3, 2003
127
US
I am trying to create a batch file that sends a text file to a printer. If the printer were local, the batch file would be;
copy mytext.txt lpt1

How can I do this with a networked printer? This is what I know about the printer.

Its address is 192.168.0.40 and the person that was giving me the info, said something about port# 1900. If I need more info, what do I need?

Thank you,

Mabjro
 
Easiest method is probably to make use of the 'lpr' command; this is available on WinNT/2000/XP.

[on NT it is part of 'TCP Print Services'; on 2000 & XP I think it is part of 'Unix Print Services', or something like that; for Win9x you can use the WinNT executable].

'lpr' uses port 515; you would use something like:

lpr -S 192.168.0.40 -P any mytext.txt

where the -S (hostname) value can be given as the IP-address (as shown in the example) or could be a name from the 'hosts' file'; the -P (queue-name) value can usually be any (as shown), although some printers insist on particular values (such as lpt1_text or lpt1_passthru).

I thinl your colleague was probably referring to port 9100 (rather than 1900); I'm not sure about how to send data directly to this port
 
Thank you, I am using Windows 98 on the end creating the file and Windows 2000 on the other end. I think your reply will be useful.
Jonathan
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top