#!/bin/bash
#sambabuk.sh FilenamePath WinHost
#
BUKFILEPATH="$1"
#Get the filename to copy to on WINHOST
BUKFILE=`basename $BUKFILEPATH`
WINHOST="$2"
#Check to see the connection is up
#Use -N for no password and -M for message
SCONNECT=`echo "SMBTEST" | smbclient -N -M $WINHOST`
#
#If it found the host, the message in $SCONNECT will
start with the word "Connected"
SSUCCESS=`echo $SCONNECT | grep "Connected" `
#
#Test $SSUCCESS and take action accordingly
if [ "${#SSUCCESS}" -gt 0 ]
then
#Success, so use -c to run the smbclient "put" command
with -N no password
#The //Name/Dir part logs into the share directory
smbclient -N //$WINHOST/SHAREDIR -c "put $BUKFILEPATH $BUKFILE"
#This will copy over an existing file so make sure to
change the file name each time
#If that is not what you want.
else
#Better give the no connection message which is in $SSUCCESS
echo "$SSUCCESS"
fi
#End of script

You can test that everything works by entering the smbclient commands at the shell prompt, before you run the script. After it is run you can run this command to list the file, replacing "WinHost" with the real Windows Host name:

$ smbclient -N //WinHost/SHAREDIR -c 'ls'

This Newbie answer has covered:

How to use the Samba client program smbclient to transfer Linux files to a Window box on a LAN.