title: Number Comparisons in Batch Code
body: <p>I'm having difficulty with number comparisons like &lt;, >, and == in my Batch code. What Im doing is generating a random number and using that answer to do something, this is what I've written:</p>
  
  <pre><code>set rand=%random%
  set rand=%rand:~1,1% 
  If %rand%==9 goto nine
  If %rand%&gt;5 goto above 5
  If %rand%&gt;1 goto above 1
  If %rand%==0 goto zero
  </code></pre>
  
  <p>And the code just closes when I run it. I tried putting space between the two objects being compared and the inequality but it still doesn't work.</p>
  
  <p>Remember, this is Batch code on Windows. </p>