[Samba] smbprint to Win XP

Adam Williams awilliam at mdah.state.ms.us
Thu Aug 17 00:05:37 GMT 2006

i have a script called /usr/bin/printfilexp that contains:

# Print from Unix on a printer on SMB network.  An assumption is that
# 'printer' was posted as a passwordless "share"
client="$USER"   # client name here...
pshare="printer"    # and here printer share name

cat $1 > $printfile
if [ -s $printfile ] ; then
  ( echo "translate" ; echo "print $printfile" ; echo "quit" ) \
  | smbclient "//$client/$pshare" -U $USER
rm -f $printfile
exit 0

and to print something you just do /usr/bin/printfilexp whatever.txt

but your unix shell name has to be the same name as your windows xp 
computer name under my computer and your printer has to be shared as 
printer on the printer sharing tab.

Terry Orgill wrote:
> My server is running Centos 4.  The printer is attached to a Win XP
> machine.  Print service is CUPS.  Samba version is 3.0.10.  I can use
> smbclient to connect to the printer and successfully print.  I have set
> the printer up with exactly the same settings as I am using with
> smbclient.  When I use lpr to print nothing prints and when I do an
> lpstat I get the message: Connection failed with error

More information about the samba mailing list