title: How to create a batch file that takes optional parameters
body: <p>I'm not a Windows guy, come from Linux side of things.
  My question is, how do I write a batch file that takes an optional switch as a boolean or value argument?  For example: </p>
  
  <p>ssh.cmd /X /l login remotehost</p>
  
  <p>Where /X is a boolean switch meaning "turn on feature X" and /l is a "value switch" meaning that the next token on the command line is to be used in a special way.  For example, in unix, you might do this: </p>
  
  <p>ssh -X -l login remotehost</p>
  
  <p>Here, -X is a boolean telling ssh to forward X ports, and -l is a "value switch" which tells ssh that my username is "login".  remotehost is a mandatory argument.  I know how to handle only the last one of these in command files, and cannot find the solution anywhere in Googlespace. </p>
  
  <p>I'm thinking that the only way to do this is to painfully wade through the arguments looking for strings that fit the right format and say "aha! found a switch!"  Is that correct?  </p>
  
  <p>Thanks in advance. </p>