title: How to get a file's manufacturer name
body: <p>I need to realize the following algorithm in a Windows 10 batch file.</p>
  
  <ul>
  <li>Loop through a directory and search for files.</li>
  <li>For each file found, get its manufacturer's name.</li>
  <li>If the manufacturer's name is for example "Microsoft", delete the file.</li>
  </ul>
  
  <p>I've already made some tries with a FOR loop and the WMIC DATAFILE without any success; I just can't get the manufacturer's name into a variable for comparison.</p>
  
  <p>I use the following code to loop through all the files (and directories):</p>
  
  <pre><code>pushd C:\&lt;path&gt;\Temp
  
  for /f "tokens=*" %%F in ('dir /a /b') do (&lt;something_with_%%F&gt;)
  
  popd
  </code></pre>
  
  <p>Then, I use the following code to get a file's manufacturer name:</p>
  
  <pre><code>wmic datafile where name="C:\\&lt;path&gt;\\Temp\\&lt;file_name&gt;.&lt;ext&gt;" get manufacturer
  </code></pre>
  
  <p>This preceding code will output (if used with the "echo" command) the following (if the target file belongs to Microsoft):</p>
  
  <pre><code>Manufacturer
  Microsoft
  </code></pre>
  
  <p>Now, the problems begin when I try to use those two pieces of code together to realize the algorithm (pseudo-code) described above. Unless there's another way to do this?</p>