title: How to run vbs file and pass argument/parameter to bat file?
body: <p>This VBS will help me to hide the CMD prompt when calling a batch file. Both files are in the same location. </p>
  
  <p>Here is my VBS code:</p>
  
  <pre><code>CreateObject("Wscript.Shell").Run "b.bat" &amp; Wscript.Arguments.Item(0),0, False
  </code></pre>
  
  <p>Here is the batch file code:</p>
  
  <pre><code>if [%1]==[] GOTO :EXIT
  Echo abc &gt; %1
  :EXIT
  </code></pre>
  
  <p>and I start my command prompt like this:</p>
  
  <pre><code>c:...\Desktop&gt;a.vbs "a.txt"
  </code></pre>
  
  <p>The error I get says this:</p>
  
  <pre><code>Error: The system cannot find the file specified.
  </code></pre>
  
  <p>The batch file will create an empty <code>txt</code> file whose name is specified as a parameter.</p>
  
  <p>Appreciate you help. Thanks.</p>