sample copy file command shell can be saved into a file called
weeklybackup.cmd (or weeklybackup.bat):
XCOPY D:\backup\accountmaster.bak \\ServerIP\D$\backup\accountmasterweekly.bak
The cmd file can
contain other operating system commands as well. It can be executed
from xp_cmdshell or SQL Server Agent just by giving the name "weeklybackup.cmd".
To turn off echo, include as first line @ECHO OFF.
Batch Files (Scripts) in Windows