title: How to do multiple commands inside a forfiles batch script
body: <p>We want to create a batch script that runs a command for each of our .xml files. The command should run for every file that does NOT end with <b>_m</b>. We try to go through each file with forfiles, but we dont know how to use <b>do</b> togheter with it.</p>
  
  <p>This is our current not working script, where we try to go through every file. Identify the filename, and substring it to not run the command if it ends with <b>_m</b>.   </p>
  
  <pre><code>forfiles /p /source /m *.xml do (
  
  set "filename=@fname"
  set "extension=_m.xml"
  set "extended=%filename%extension"
  
  
  IF NOT %filename:~-2%=="_m"(
      ssoadm import-entity --cot something--realm something--spec saml2 -m @file -x %extended --adminid something--password-file password --debug
  )
  </code></pre>
  
  <p>Thanks for any help!</p>