title: batch file - validate parameters
body: <p>i have a batch file which should take inputs "-input1", "-input2" and "-input3". Here i need to validate the paramters like if user give the input parameter as "-test" or "-blah" or anyother parameter, then i should throw the error as "unregonized parameter". How can i achieve this? i tried by iterating through the paramters as %1 %2 etc. but i could not achieve the required behaviour.</p>
  
  <pre><code>IF "%1"=="" (
   GOTO :ERROR3
  )
  IF "%1"=="-input1"  (
   SET value1=%2
  )
  @IF "%3"=="-input1"  (
   SET value1=%4
  )
  @IF "%5"=="-input1"  (
   SET value1=%6
  )
  @IF "%7"=="-input1"  (
   SET value1=%8
  )
  IF "%1"=="-input2" (
   SET value1=%2
  )
  @IF "%3"=="-input2" (
   SET value2=%4
  )
  @IF "%5"=="-input2" (
   SET value2=%6
  )
  @IF "%7"=="-input2" (
   SET value2=%8
  )
  IF "%1"=="-input3" (
   SET value3=%2
  )
  @IF "%3"=="-input3" (
   SET value3=%4
  )
  @IF "%5"=="-input3" (
   SET value3=%6
  )
  @IF "%7"=="-input3" (
   SET value3=%8
  )
  
      // some codes here
  
  :ERROR1
  ECHO "ERROR1"
  GOTO :END
  :ERROR2
  ECHO "ERROR1"
  GOTO :END
  :ERROR3
  ECHO Usage SAMPLE.bat -input1 "value1" -input2 "value2" -input3 "value3"
  :END
  </code></pre>
  
  <p>Any help..</p>