The following code in a batch file which gets the password from user Thru a HTA dialog box. It works fine. I want to pass a variable value !user[%%a]! to be displayed inside the pop up HTA dialog box so I can see
Enter password for User ID: "BATCH FILE USER VARIABLE"
in this window :
How can I do that?
<!-- :
@setlocal enableextensions enabledelayedexpansion
:: PasswordSubmitter.bat
@echo off
set user[1]=me1
set user[2]=me2
set user[3]=me3
for /l %%a in (1,1,3) do (
set counter=%%a
for /f "tokens=* delims=" %%p in ('mshta.exe "%~f0"') do (
set pass[!counter!]=%%p
)
echo Password for User-!user[%%a]! is "!pass[%%a]!"
)
endlocal
exit /b
<html>
<HEAD><title>Password submitter</title>
<HTA:APPLICATION INNERBORDER="no" SYSMENU="no" SCROLL="no" >
<style type="text/css">
body {
color: white;
background: black;
font-family: "Calibri", monospace;
}
</style>
</HEAD>
<body>
<p>Enter password for User ID</p>
<script language='javascript' >
window.resizeTo(400,200);
function pipePass() {
var pass=document.getElementById('pass').value;
var fso= new ActiveXObject('Scripting.FileSystemObject').GetStandardStream(1);
close(fso.Write(pass));
}
</script>
<input type='password' name='pass' size='16'></input>
<hr>
<button onclick='pipePass()'>Submit</button>
</body>
</html>