title: XCOPY Folder with Variable Name and Spaces
body: <p>I want to create a batch that deletes files from some folders and then copies them back into them from another destination (another server). Some of these folders will have variable names because they are named based on the month and the year. For example one of the destinations contains folders named like these :</p>
  <pre><code>-01 January 2015
  -02 February 2015
  -03 March 2015
  etc.
  </code></pre>
  <p>I've managed to make the delete process work, but when it's time to copy I get this error :</p>
  <pre><code>xcopy is not recognized as an internal or external command, operable program or batch file.
  </code></pre>
  <p>Here is the code :</p>
  <pre><code>    echo off
      for /f &quot;tokens=2 delims==&quot; %%a in ('wmic OS Get localdatetime /value') do set &quot;dt=%%a&quot;
      set &quot;YYYY=%dt:~0,4%&quot;
      set &quot;MM=%dt:~4,2%&quot;
      set &quot;DD=%dt:~6,2%&quot;
      set &quot;HH=%dt:~8,2%&quot;
      set &quot;Min=%dt:~10,2%&quot;
      set &quot;Sec=%dt:~12,2%&quot;
      set &quot;YY=%dt:~2,2%&quot;
      
      if %MM%==01 set Month=January
      if %MM%==02 set Month=February
      if %MM%==03 set Month=March
      if %MM%==04 set Month=April
      if %MM%==05 set Month=May
      if %MM%==06 set Month=June
      if %MM%==07 set Month=July
      if %MM%==08 set Month=August
      if %MM%==09 set Month=September
      if %MM%==10 set Month=October
      if %MM%==11 set Month=November
      if %MM%==12 set Month=December
      
      
      set path=-%MM% %Month% 20%YY%
      
      del /f/s/q &quot;P:\WX\%path%\Today&quot;
      
      xcopy &quot;F:\WX\%path%\Today&quot; . &quot;P:\WX\%path%\Today&quot; /s/e/y
        
  </code></pre>