title: How to check how many inputs user entered in batch file?
body: <p>So iam trying to make a script that if the user enters &quot;listproc 100&quot; it displays tasklist and filters PID value by if its greater then or equal to 100,and if user enters 2 inputs e.g &quot;listproc 100 500&quot; it will do tasklist of PID values that are greater then or equal to 100 and also less then or equal to 500.However Iam using a goto,is there a way I can do this without having to ask the user if they have entered 1 or 2 inputs, and be able to make the script work it out on its own.So for exmaple if i entered &quot;listproc 100 500&quot; it would show result and not have to ask if i entered 1 or 2 inputs.</p>
  <pre><code>@echo off
  
  set /p &quot;input=1 or 2 inputs&quot;
  
  REM asks user how many inputs they entered
  
  if &quot;%input%&quot; == &quot;1&quot; (
      goto one
  )
  
  if &quot;%input%&quot; == &quot;2&quot; (
      goto two
  )
  
  REM filters depending on number of inputs
  
  :one
  tasklist /FI &quot;PID ge %1&quot;
  
  :two
  tasklist /FI &quot;PID ge %1&quot; /FI &quot;PID le %2&quot;
  
  </code></pre>