title: Search for string within filename in subdirectories
body: <p>I have a large directory of folders (call it C:\Main).  I need to set up a batch script to search the subfolders of that directory for a string within the filename (not the text within the file).  I'm having trouble finding an answer.</p>
  
  <p>Essentially, let's say I need to search for the string "abcd" within all the filenames in C:\Main\*.  I'm only looking for matches that are a XML file.  So I need to find:</p>
  
  <p>C:\Main\Secondary1\abcd_othertext.xml</p>
  
  <p>C:\Main\Secondary2\abcd_othertext.xml</p>
  
  <p>C:\Main\Secondary3\abcd_othertext.xml</p>
  
  <p>among all the hundreds of folders in that Main directory.  Then I need to output all matches (ideally to individual variables in a bat file, but that's a different can of worms).  Thanks in advance for your help.</p>