recursively copy directory with smbclient

When using smbclient to copy a directory, make sure to use the recurse and prompt commands. This makes it possible to non-interactively copy a directory and all of its contents:

smbclient -Udomainname/fordodone //10.234.92.21/sharename
Password:
Domain=[DOMAINNAME] OS=[Windows 5.0] Server=[Windows 2000 LAN Manager]
smb: \> cd testdir
smb: \testdir\> get C
NT_STATUS_FILE_IS_A_DIRECTORY opening remote file \testdir\C
smb: \testdir\> prompt
smb: \testdir\> recurse
smb: \testdir\> mget C
getting file ...

use smbclient to connect to CIFS share from linux

To connect to a Windows network drive, or CIFS share, you can use a simple Linux utility called smbclient. This is much faster than trying to map a network drive through Windows. You can use this simple tool to test that the file server is working correctly.

# smbclient --user="DOMAIN\fordodone" //10.107.0.101/share_name
Enter DOMAIN\fordodone's password:
Domain=[DOMAIN] OS=[Windows 5.0] Server=[Windows 2000 LAN Manager]
smb: \> 

You can use commands like cd, ls, cp, etc. to interact with the share (similar to FTP).