title: batch command to copy a file when modified date is same as current date
body: <p>Batch command will check one file's modified date. if the modified date is equal to the current date then it will copy the file to different location by creatibng a folder of current date.
  i have used the code below :</p>
  
  <pre><code>@echo off
  set currentDate=%date%
  SET filename="C:\Documents and Settings\302444\Desktop\inventory.txt"
  FOR %%X IN (%filename%) DO SET filedatetime=%%~tX
  pause
  
  if %filedatetime:~0, 10% == %currentDate% 
  pause
  (ROBOCOPY C:\Documents and Settings\302444\Desktop   C:\Documents and Settings\302444\Desktop\IMP\%date:~-4,4%%date:~-10,2%%date:~-7,2% inventory.txt
  pause
  )
  
  if %filedatetime:~0, 10% LSS %currentDate%
  (echo file not updated
   pause
  )
  </code></pre>
  
  <p>But the if statement is not working here. please advice me on the same </p>