To copy contents of a password protected network shared folder in one server to another server, you can use
Syntax of xcopy command is:
xcopy source [destination] [/a | /m] [/d:date] [/p] [/s] [/e] [/w] [/c] [/i] [/q] [/f] [/l] [/h] [/r] [/t] [/u] [/k] [/n]
You can use this code in a scheduled batch script on your backup server, to copy contents of a backup folder from a server in other or the same domain:
net use F: \\192.168.7.21\Backup /user:domain\user_name p@ssw0rd /persistent:no
xcopy F: D:\Database_Backup\ /y
It uses the
Net Use command to map a network drive (as F: drive for example), using a username and password of a user with access permissions on that folder and with non persistent connection.
/y switch overwrites existing files without prompting you.
You can see switches that you can use with Xcopy and Xcopy32 Commands here: