title: Batch File to delete files last accessed or created, older than X days
body: <p>I'm looking to end my batch scripting code in order to delete accdb files older than 7 days, the code that I have already deletes files, but  it takes "Last Modification Date" I need to change this to "Last Accessed Date" or "Creation Date".</p>
  
  <p>is there a way to do it in a Bat File or should I move to PowerShell? </p>
  
  <p><a href="https://i.stack.imgur.com/YSaRX.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/YSaRX.png" alt="Access Database Dates - Example"></a></p>
  
  <p>Batch Code:</p>
  
  <pre><code>forfiles /P O:\Backup\ /S /M *.accdb /D -7 /C "cmd /c del @PATH"
  </code></pre>
  
  <p>I've already read similar questions but I didn't figure it out.</p>