title: Passing parameters from vbscript to batch file
body: <p>Hi I am having an issue passing parameters through a vbscript to a batch file.
  I am not very good at programming so I am sure I am just missing something stupid.
  Anyway I am using the vbscript to invisibly run the batch file</p>
  
  <p>The vbscript is called as <code>"C:\Program Files (x86)\scripts\check.vbs"  %S "%D"</code></p>
  
  <p>Where %S is state and %D is directory.</p>
  
  <p>If I call the batch file directly as <code>"C:\Program Files (x86)\scripts\checkdir.bat"  %S "%D"</code> everything works fine except there is a dos windows that pops up which is annoying.</p>
  
  <p>So I looked around the internet and found this vbscript that can run a batch file silently. It does in fact run it silently however it does not pass the parameters to the batch file. </p>
  
  <p>Here is the vbscript:</p>
  
  <pre><code>Set WshShell = CreateObject("WScript.Shell") 
  WshShell.Run chr(34) &amp; "C:\Program Files (x86)\scripts\checkdir.bat" &amp; Chr(34), 0
  Set WshShell = Nothing
  </code></pre>
  
  <p>How would I go about passing the parameters? I have searched but I could not come up with anything that worked for me, I would either get an error on running it or the parameters would not pass.</p>