sample copy file command shell can be saved into a file called
XCOPY D:\backup\inventory.bak \\ServerIP\D$\backup\inventorydaily.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".
The file can be edited with NotePad.
How to read notepad text file into a table?