title: Y or N statements in Batch files
body: <p>I am a dabbler in batch files so my knowledge is limited to my experiences. What I am trying to do is limit the "Y or N" inputs to just that Y or N. Right now you can put anything in the fields and the code progresses. What I am attempting to do is create a hotspot using a batch file. I have yet to figure out how to "save" the created network but that isn't really an issue.</p>
  
  <p>I have included what I have, the lines being the start and finish, If anyone happens to see anything that can be improved upon or made less bulky feel free to comment.</p>
  
  <pre><code>@echo off
  :: BatchGotAdmin
  :-------------------------------------
  REM  --&gt; Check for permissions
  &gt;nul 2&gt;&amp;1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system"
  REM --&gt; If error flag set, we do not have admin.
  if '%errorlevel%' NEQ '0' (
      echo Requesting administrative privileges...
      goto UACPrompt
  ) else ( goto gotAdmin )
  :UACPrompt
      echo Set UAC = CreateObject^("Shell.Application"^) &gt; "%temp%\getadmin.vbs"
      echo UAC.ShellExecute "%~s0", "", "", "runas", 1 &gt;&gt; "%temp%\getadmin.vbs"
      "%temp%\getadmin.vbs"
      exit /B
  :gotAdmin
      if exist "%temp%\getadmin.vbs" ( del "%temp%\getadmin.vbs" )
      pushd "%CD%"
      CD /D "%~dp0"
  :-------------------------------------- 
  @echo off
  :SSID
  set /P inputA="Input desired Network SSID:"
  echo.
  set /P c=Is %inputA% correct? [Y/N]?
  echo.
  if /I "%c%" EQU "Y" goto :PSWD
  if /I "%c%" EQU "N" goto :SSID
  :PSWD
  set /P inputB="Input desired 8 to 63 character Network Password:"
  echo.
  set /P c=Is %inputB% correct? [Y/N]?
  echo.
  if /I "%c%" EQU "Y" goto :SETUP
  if /I "%c%" EQU "N" goto :PSWD
  :SETUP
  netsh wlan set hostednetwork mode=allow ssid=%inputA% key=%inputB% &gt;NUL
  @echo Creating Network...
  echo.
  timeout /t 5 /nobreak &gt; NUL
  @echo Network Created!
  echo.
  timeout /t 1 /nobreak &gt; NUL
  set /P c=Would you like to start your new Network? [Press "Y" to continue/Press "N" to abort]
  if /I "%c%" EQU "Y" goto :START
  if /I "%c%" EQU "N" goto :BYE
  :START
  netsh wlan start hostednetwork
  timeout /t 5 /nobreak &gt; NUL
  @echo Your Network has started!
  pause
  :BYE
  Exit
  </code></pre>