title: How to use multiple commands in batch using forfiles command?
body: <pre><code>@ECHO OFF
  
  SET backdir=backup
  SET snapshotdir=snapshots
  SET worldprefix=world_
  SET itdate=%date:~10,4%-%date:~4,2%-%date:~7,2%
  SET hour=%time:~0,2%
  
  IF "%hour:~0,1%" == " " SET hour=0%hour:~1,1%
  
  echo Current date: %itdate%. Current hour: %hour%. Current Minute:Second: %time:~3,2%:%time:~6,2%
  
      forfiles /m "%worldprefix%*" /c (
          echo Copying World: @path
          cmd /c xcopy /e /c /h /i /v /r /y /q @file %snapshotdir%\@file\%itdate%-%hour%-%time:~3,2%-%time:~6,2%
          cmd /c xcopy /e /c /h /i /v /r /y /q @file %backdir%\%itdate%D\worlds\@file
       )
  
  echo Copying Plugins
  xcopy /e /c /h /i /v /r /y /q plugins %backdir%\%itdate%D\plugins\
  xcopy /e /c /h /i /v /r /y /q %backdir%\%itdate%D %backdir%\%itdate%-%hour%H\
  
  echo Backup Complete (assuming no errors above).  Attempting to remove old files..
  forfiles /p "%snapshotdir%" /c "cmd /c rmdir /s /q @path" /d -7
  forfiles /p "%backdir%" /m "*H" /c "cmd /c rmdir /s /q @path" /d -2
  forfiles /p "%backdir%" /m "*D" /c "cmd /c rmdir /s /q @path" /d -14
  
  PAUSE
  </code></pre>
  
  <p>I am trying to copy all files with "world_" as a prefix. I run into a problem when I try to use multiple commands in a loop. I have attempted to write the batch script I want above.</p>