Use Notepad to create a .BAT file containing the following:@echo off
rem For the following line, substitute the location of SQLCMD.EXE on your system
cd /d "C:\Program Files\Microsoft SQL Server\100\Tools\Binn"
sqlcmd.exe -S SERVER\Instance -E -Q "BACKUP DATABASE DatabaseName TO DISK = 'C:\Backups\Database.bak' WITH INIT"
Where:
SERVER\Instance — the server name and SQL Server instance (use syntax .\Instance if the server is local. Append “,n” for a non-standard port n. See here for more syntax);
DatabaseName — The name of the database being backed up (if the database name contains hyphens, enclose it in []);
WITH INIT — Causes the backup to overwrite the existing file (leave out if append is required).
NB the command-line options for SQLCMD such as -S, -E etc must be upper case.