title: generate backup file using date and time as filename
body: <p>How do I do this properly. I'm trying to name the sql file that is being produced by mysqldump into the current date and time. I've already some research in this site and found a code in here: <a href="https://stackoverflow.com/questions/203090/how-to-get-current-datetime-on-windows-command-line-in-a-suitable-format-for-usi">How to get current datetime on Windows command line, in a suitable format for using in a filename?</a></p>
  
  <p>Tried to mixed it up with my current code and I came up with this one. The file is named into the current date and time but its only a 1kb file and does not produce a .sql file. 
  It is supposed to be a 7 kb sql file.</p>
  
  <pre><code>@For /f "tokens=2-4 delims=/ " %%a in ('date /t') do @(set mydate=%%c-%%a-%%b)
  @For /f "tokens=1-2 delims=/:" %%a in ('time /t') do @(set mytime=%%a%%b)    
  
  @echo mydate= %mydate%
  @echo mytime= %mytime%
  
  mysqldump -u root -p --add-drop-table --create-options --password= onstor &gt;c:\%mydate%_%mytime%.sql
  </code></pre>
  
  <p><strong>UPDATE</strong>
  I don't think there's a problem with the mysqldump command since it works well when I do it this way. The code below just uses the date as its filename. </p>
  
  <pre><code>@For /F "tokens=2,3,4 delims=/ " %%A in ('Date /t') do @( 
      Set Month=%%A
      Set Day=%%B
      Set Year=%%C   
  )    
  
  @echo DAY = %Day%
  @echo Month = %Month%
  @echo Year = %Year%    
  
  mysqldump -u root --add-drop-table --create-options --password= onstor &gt;c:\%Day%-%Month%-%Year%.sql
  </code></pre>
  
  <p>Please help, thanks. </p>