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.
This is what I have so far - Batch:
<!-- :: 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 attempted to use %model%
as a parameter, and I tried to use arg1
in my VBScript section to try to use that variable - but it did not work.
So in my hta section, this is my vbscript:
<script language="VBScript">
MsgBox arg1
</script>
Which just opens an empty box.
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 & batch hybrid, but I want to avoid doing that for simplicity.
Any help would be much appreciated