title: Robocopy last modified: more accurate than a day?
body: <p>I'm working on a Windows batch file to perform a two-way sync with a server. The batch file will be used by multiple people to syncronize several computers with a single network location. Due to restrictions I won't get into, it HAS to be a batch file. No vbscript, no javascript, only windows batch. Powershell commands may be okay as long as I can run them from inside the batch file.</p>
  
  <p>In order to allow file deletions, it runs robocopy several times. First, it copies files newer than the last time the script was ran using the /MAXLAD switch. It does this in both directions. Then, it does a mirror with the /l switch and checks the exit code to detect extra files. If either side has extra files, it runs the mirror for real, in the appropriate direction.</p>
  
  <p>The script works well as-is, but...</p>
  
  <p>The problem is, /MAXLAD accepts a date in the form YYYYMMDD, so if you create a file locally, run the sync script, then immediately delete the file and sync again, it comes back from the grave. In order to successfully delete a file it needs to have been unmodified for a least a day prior to the last time you ran the script. I would like some way of removing this restriction, so it can be ran as often as my users please and work as expected.</p>
  
  <p>My question is this: Is there some way to be more precise with the last access time? Even if I could narrow it to the hour, it'd be an improvement. Should I be doing something other than robocopy to copy the new files?</p>