title: Append Date to Filename in Windows Batch File
body: <p>I have a batch file which backs up my SQL Database and want to append the date to the end of the file created.</p>
  
  <blockquote>
    <p>sqlcmd -U sa -P pwd -S SERVER\SQL2012 -Q "BACKUP DATABASE [MYDB] TO 
    DISK = N'E:\Databases\MYDB.bak' WITH NOFORMAT, NOINIT,  NAME =
    N'MYDB-Full Database Backup', SKIP, NOREWIND, NOUNLOAD,  STATS = 10"
    -d "MYDB"</p>
  </blockquote>
  
  <p>Currently all my back ups are getting added to the MYDB.bak file but I want to have new file names for each backup with the date e.g. MYDB20141028.bak</p>