title: Script to copy files for last month
body: <p>I am trying to copy files using robocopy. The files I want to copy should be of last month(not one month old) i.e. on if I am running the script in the march month(any day) then it should copy all the files with timestamp of february. I am using below script:  </p>
  
  <pre><code>robocopy source/*.prev destination maxage:20180201 minage:20180228
  </code></pre>
  
  <p>How to use the date as a variable here so I don't have to manually change it every month?</p>