title: Killing a process in Batch and reporting on success
body: <p>i have the following batch file, which terminates the iTunes program so, that if i connect my iPod, it's not going to sync it. (I know you can set this up in iTunes.)</p>
  
  <pre><code>@echo off
  :kill
  cls
  taskkill /F /IM itunes.exe &gt;nul
  if %errorlevel%==1 {
  echo iTunes not found.
  } else {
  echo iTunes is killed.
  }
  goto kill
  </code></pre>
  
  <p>However, the <code>&gt;nul</code> does not respond to the command; so it just gives the default command text. So yeah, what i want to do:</p>
  
  <p>If iTunes is not found, as given by the command, it should display </p>
  
  <blockquote>
    <p>iTunes not found</p>
  </blockquote>
  
  <p>If it is found and terminated,</p>
  
  <blockquote>
    <p>iTunes is killed</p>
  </blockquote>
  
  <p>Help? the errorlevel's don't work, this seem to be the fault of the <code>nul</code> not working.</p>