title: batch - check if variable is not empty and perform action
body: <p>I have the following batch code:</p>
  
  <pre><code>set checkerr=
  for /f "delims=" %%a in ('findstr "Error" %LOG%') do @set checkerr=%%a
  
  
  echo %checkerr%
  
  
  if "%checkerr%" NEQ [] GOTO sendmail
  </code></pre>
  
  <p>But it is not working, I want it to send a mail only if the text string "Error" is found in the log file</p>
  
  <p>Note: Errors in the log file might look like this:</p>
  
  <pre><code>20131117185439:       Error: Field not found - &lt;blablabla&gt;
  20131117185445:       General Script Error
  20131117185445:       Execution Failed
  20131117185445:      Execution finished.
  </code></pre>
  
  <p>So there are spaces and other chars, etc</p>
  
  <p>Regards</p>