title: Batch file searching for multiple file formats in FOR loop
body: <p>I'm coding a batch file that should search two folder paths for multiple file extensions and list them in a text file. Currently I'm trying to use a FOR loop with a list of file extensions (*.doc, *.docx, etc). I believe the file is erroring out because of the "*" character but I don't know how to correct this.</p>
  
  <p>I've tried to straight list them: <code>FOR %%G IN (*.one,*.mht,*.onepkg)</code>. I've tried quote marks: <code>FOR %%G IN ("*.one","*.mht","*.onepkg")</code>. I've tried carets: <code>FOR %%G IN (^^*.one,^^*.mht,^^*.onepkg)</code>.</p>
  
  <p>Here's my code:</p>
  
  <pre><code>set outputfilepath=d:\output.txt
  
  FOR %%G IN ("*.one","*.mht","*.onepkg") DO (
  echo Searching for %%G files
  dir "C:\%%G" /s /b &gt;&gt; "%outputfilepath%"
  Rem Add 2 blank lines between next search
  echo. &gt;&gt; "%outputfilepath%"
  echo. &gt;&gt; "%outputfilepath%" )
  </code></pre>
  
  <p>Nothing gets output to my text file.</p>
  
  <p>Any help is appreciated.</p>