title: Comparing Strings in Batch
body: <p>I am having a lot of trouble comparing a string in a variable to an actual string in batch. Here's the script:</p>
  
  <pre><code> set failure=0
   for /F "usebackq delims=" %%L in (`"wmic PRINTER where name='10.146.2.52 - HP Color LaserJet CP5225n' GET Name 2&gt;&amp;1"`) do (
   ::Quotes around variable seem to have no effect. Same result w/ or w/o them.
   if /I "%%L"=="No Instance(s) Available." set failure=1
   echo %failure%   %%L
   )
  </code></pre>
  
  <p>Here's the output:</p>
  
  <p><img src="https://i.stack.imgur.com/IYPAm.png" alt="enter image description here"></p>
  
  <p>Why does the if statement fail? The values clearly match. Please help!!</p>