title: Batch script to move zip files based on year modified
body: <p>I realize there are a lot of questions already answered about doing something similar. I have researched what I am trying to do and didn't find anything that seemed to apply to what I am trying to do. There are a few factors combined in what I am trying to do and <em>I don't know a lot about batch scripting</em>.</p>
  
  <p>First, I need to look at zip files with a certain naming scheme only. The way these are named is file1234.zip, file2345.zip, file3456.zip, etc... This naming scheme is automatically generated and already in place. The number in the name has nothing to do with the date it was modified or created. There are other zip files in the source directory I would want to ignore. <code>This can be solved with wildcards. "file*.zip"</code></p>
  
  <p>Next, I need to move only certain files fitting the above criteria, that were modified within a specific year. i.e. move zip files modified in 2000 but leave all other files alone. The year the files were modified would be a constant and would be designated in the script.</p>
  
  <p>When combined, if file2345.zip was modified in 2000 and the other files were last modified in other years, then file2345.zip would be moved and all others would be ignored.</p>
  
  <p>What I have learned:</p>
  
  <p>Wildcards are valid characters in the middle of a file name.</p>
  
  <p>To get the dates modified for all files matching my naming criteria</p>
  
  <pre><code>forfiles /M file*.zip /C "cmd /c echo @file @fdate"
  </code></pre>
  
  <p>With the above, how do I look at just the four-digit year?</p>
  
  <p>I have no objections to using xcopy or robocopy for the actual file move.</p>
  
  <p>Any suggestions or ideas would be greatly appreciated.</p>