I am trying to write a batch + hta hybrid script that will allow me to pass variables from the script package section to the hta section so that I can generate things like computer model number, etc.
This is what I still have - Package:
<!-- :: 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
-->
As you can see, I tried to use %model%as a parameter, and I tried to use arg1the VBScript section to try to use this variable, but that didn't work.
So, in my hta section, this is my vbscript:
<script language="VBScript">
MsgBox arg1
</script>
Which only opens an empty box.
- , , . , script, , hta batch, .