title: Batch job to delete folder older than 7 days on windows 7
body: <p>Hi I need to delete folders on my Windows 7 computer which are older than 7 days and have data in it.</p>
  
  <p>I have used the following commands which haven't worked out well for me </p>
  
  <ol>
  <li><code>FORFILES /S /D -10 /C "cmd /c IF @isdir == TRUE rd /S /Q @path"</code></li>
  <li><code>forfiles -p "C:\what\ever" -s -m *.* -d &lt;number of days&gt; -c "cmd /c del @path"</code></li>
  </ol>
  
  <p>The second command which I referred from <a href="https://stackoverflow.com/questions/51054/batch-file-to-delete-files-older-than-n-days">Batch file to delete files older than N days</a> 
  also didn't work for me.</p>
  
  <p>Can someone please suggest what to use in the second command on <code>C:\what\ever</code> or suggest an alternative command to delete my folders older than 7 days.</p>