How to copy a file from unix machine to windows machine, from commandline.
Assuming that, the Windows box have a shared folder. You can use smbclient command. Which provide a FTP-like command line interface over the SMB protocol.
This post provide a ready to use example, which looks a perfect answer.
If you need to copy files to or from a windows server from a unix server, you can use an utility from the Samba software suite called smbclient.
Here is an example to copy a file to a Windows server:
smbclient //WIN_SERVER/SHARE -l WIN_SERVER_IP -A AUTHFILE -c "put TRANSFER_FILE_LOCAL TRANSFER_FILE_REMOTE"
WIN_SERVER = the name of your Windows server
SHARE = the name of your Windows share
WIN_SERVER_IP = the IP address of your Windows server
AUTHFILE = full path to your authentication file name. The file contents should include:
username = mywinuser password = mywinpass domain = MYDOMAIN
TRANSFER_FILE_LOCAL = full path to Unix file to transfer
TRANSFER_FILE_REMOTE = new file name on Windows server
For more help or options using smbclient, type "smbclient -h"
If your windows machine is on the same network, you can share your unix filesystem with smb and mount it on the windows machine, then use "cp" to transfer the file.
You can find information about smb for ubuntu here https://help.ubuntu.com/10.04/serverguide/C/samba-fileserver.html
You can use PSFTP to download/upload files to / from Unix server from your Windows machine.
You may see this guide.