title: HTA & Batch Hybrid, passing variables from BATCH section
body: <p>I'm attempting to write a batch + hta hybrid script that will allow me to pass variables from the batch section of the script to the hta section, so that way I can generate things like the computers model number etc.</p>
  
  <p>This is what I have so far - Batch:</p>
  
  <pre><code>&lt;!-- :: Batch section
      @echo off
      Pushd "%~dp0"
      setlocal
  
      FOR /F "tokens=2 delims='='" %%A in ('wmic ComputerSystem Get Model /value') do SET model=%%A
  
      for /F "delims=" %%a in ('mshta.exe "%~F0" "%model%"') do set "HTAreply=%%a"
      echo End of HTA window, reply: "%HTAreply%"
      goto :EOF
      --&gt;
  </code></pre>
  
  <p>As you can see I attempted to use <code>%model%</code> as a parameter, and I tried to use <code>arg1</code> in my VBScript section to try to use that variable - but it did not work.</p>
  
  <p>So in my hta section, this is my vbscript:</p>
  
  <pre><code>&lt;script language="VBScript"&gt;
  
      MsgBox arg1
  
  &lt;/script&gt;
  </code></pre>
  
  <p>Which just opens an empty box.</p>
  
  <p>I've been searching for a while online trying to figure out a way to do this and I cannot figure it out. The way I got around this before was basically creating a batch script that creates a new file which is the hta &amp; batch hybrid, but I want to avoid doing that for simplicity.</p>
  
  <p>Any help would be much appreciated</p>