title: Errorlevel is returning 0 but i can not set string variable using if
body: <p>I am running DISM command and trying to find two strings in it and on finding the strings it should return Errorlevel 0. It is returning 0, and on getting a Errorlevel 0 i want to set a string variable value but i am not getting my results. Below is my code if someone can help.</p>
  
  <pre><code>     @echo off
       dism /get-wiminfo /wimfile:install.wim /index:8 | Findstr "Professional x64"  &gt;nul
       echo %ERRORLEVEL%
       PAUSE
       if %ERRORLEVEL% == 0 (
       Set MYOS = "PROX64"
       )
       ECHO %MYOS%
       pause
  </code></pre>