title: Batch file finding a filename which contains a substring
body: <p>I want to write a batch file to find all .vsdm files and the file name must contain a substring "2.4". But my code is telling me that all my .vsdm files contains the substring "2.4" which is not correct.</p>
  
  <pre><code>FOR /R %completepath% %%G IN (*.vsdm) DO (
  set file=%%~nG
  
  If not "%file%"=="%file:2.4=%" (
      echo Filename contains 2.4
  ) else (
      echo Filename does NOT contains 2.4
  )
  )
  </code></pre>
  
  <p>Can anyone tell me where did I get it wrong?Thanks</p>