title: Determine if Tomcat is running in Windows using the command prompt
body: <p>Quite simply, how does one determine whether or not Tomcat is running in Windows, using the command prompt?  </p>
  
  <p>I am writing a batch script that must do this. This is the <a href="http://en.wikipedia.org/wiki/Bash_%28Unix_shell%29" rel="noreferrer">Bash</a> version:</p>
  
  <pre><code>RESULT=`netstat -na | grep $2 | awk '{print $7}' | wc -l`
  </code></pre>
  
  <p>Where $2 is the port.</p>
  
  <p>I am looking for something similar to that. Using <a href="http://en.wikipedia.org/wiki/Cygwin" rel="noreferrer">Cygwin</a> is out of the question, of necessity this script must be able to run on machines that only have Tomcat.</p>