title: Is there any way to reject unwanted inputs in a batch script?
body: <p>I'm making a simple batch script that has 4 options--4 different things built into it. It accepts 1, 2, 3, and 4. Only issue is, if the user inputs anything <em>other</em> than that, it defaults to 1. Which I do not want. I'm tired and my Googling hasn't been that sharp--what I'm asking is if there's a way to check if the input for %op% (variable in use) is not equal to 1, 2, 3, or 4. And if it is not one of those; tell the user to try again. Code snippet is attached:</p>
  
  <pre><code>:check_Permissions
      echo Did you run the script as admin?
      timeout /t 1 /nobreak &gt; NUL
      net session &gt;nul 2&gt;&amp;1
      if %errorLevel% == 0 (
          echo Script run as administrator, continuing.
          timeout /t 1 /nobreak &gt; NUL
          goto options
      ) else (
          timeout /t 1 /nobreak &gt; NUL
          echo Please re-run the script as an admin. Press any key to exit.
          pause&gt;nul
          exit
      )
  
  :options
  echo.
  echo ==================================
  echo 1. (First option)
  echo 2. (Second option)
  echo 3. (Third option)
  echo 4. (Fourth option)*
  echo *: (Note to fourth option)
  echo.
  echo Please pick one of the options.
  echo ==================================
  set /p op=Selection: 
  if "%op%"=="1" goto lorem
  if "%op%"=="2" goto ipsum
  if "%op%"=="3" goto dolor
  if "%op%"=="4" goto sit
  </code></pre>