title: Efficiently passing multiple switches to a batch file?
body: <p>What is the most efficient method of passing multiple command line arguments to a batch file in this format?</p>
  
  <pre><code>PACKER.BAT /Action="Pack" /Source="..\path to source folder\" /Target="..\path to target folder\" /Pass="SecretCode" /Output="Packed.exe" /GPGhome="..\path to GnuPG home directory\" /User="UserID" /Admin="AdminID" /Profile="ProfileID"
  </code></pre>
  
  <p>In the .BAT I want to strip the leading “/” and “SET” the switches as environment variables.</p>
  
  <p>The variables will be passed to 7Zip, GPG, DWipe and some basic error checking.  For use in Vista, Win7 and Win8.</p>
  
  <p>PACKER.BAT notes and snippets...</p>
  
  <pre><code>:Start
  :: Prepare the Command Processor &amp; initialise variables
  Set colours, title, comments, errorlevels, etc.
  Read variables from general profile file, etc.
  Process command line arguments
  
  :Lock
  if exist %Lock% @echo ž   WARNING:  %ProfileID%  is running.
  
  :Check
  if exist %Action%="Pack" do ... else UnPack, etc.
  if exist %Source% do ... else error
  if exist %Target% do ... else create
  
  :Zip
  %7Zexe% u -ms=off -mtc=on -ssw -w%Temp% -p%Pass% -mhe=on %sfx:"=% %Target%%Output% %Source%
  
  :GPG
  %GPGexe% --homedir %GPGhome% -r %UserID% -r %AdminID% -e %Target%%Output%
  
  :Wipe
  %DWexe% wipe1 %Target%%Output%
  
  :Help
  @echo Allowable switches for %ProfileID%:
  @echo %Menu:"=%
  
  :End
  :: clean up environment variables
  </code></pre>
  
  <hr>
  
  <p>¯¯¯¯</p>