Command-line printing (like 'lpr' in Linux)

R

Renan (tm)

Hello,

In Linux, I can output a text file to a local printer by doing:

cat <file name> | lpr

or pipe a command via '<command> | lpr'.

This comes really useful when I want to print from a shell script.

Q: Is there a similar utility for Windows?

I'm using Windows XP, so output directly to the parallel port doesn't
work well, and thus redirection ('> lpt1') is not an option.

Windows XP seems to have a (rather strange) LPR utility (!!) but it
isn't similar to the UNIX one.

Thanks!
 
B

B. R. 'BeAr' Ederson

I want to print from a shell script.

Look at the internal Print command for a more simple syntax than the
one provided by XP Lpr:

www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/print.mspx

If you need additional formatting of the text, then use a preprocessor
like pr.exe from the UnxUtils:

http://unxutils.sourceforge.net

before sending it to the printer.

XP provides some *.vbs scripts for additional printer control. You can
have a look at these, too. (Scroll down to the commands starting with
Prn.):

www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/ntcmds.mspx

HTH.
BeAr
 

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

Top