在 HTA 应用程序中发送 WScript.Shell 中的输入值

Send input value in WScript.Shell inside HTA application

我正在尝试制作一个重启应用程序,它从 HTML 输入按钮开始需要几秒钟,并将其发送到包含 WScript.Shell.

的 JS 函数
<script>
function languages(){
  var test = document.getElementById("myInput").value;

  var shell = new ActiveXObject("WScript.Shell");
  var path = "shutdown -r -t " & test;
  shell.run(path,1,false);
}
</script>
<div align="center">
  <img src="restartICO.png" />
  <br>
  <br>
  <input id="myInput" type="number" />
  <br>
  <br>
  <br>
  <br>
  <button class="blokirebaARA2" onclick="languages();"
    title="შლის ენებს და ამატებს ხელახლა GE & RUS">GE-RUS</button>&nbsp;&nbsp;&nbsp;
</div>

我不知道如何正确传递htis格式的变量

这是在 HTA 应用程序中发送变量的方式:

function restart(){
  var testr = document.getElementById("myInput").value;
  if (testr == "") {
  var shell = new ActiveXObject("WScript.Shell");
  var path = "shutdown -r -f -t 0";
  shell.run(path,1,false);
  }
  else {
  var shell = new ActiveXObject("WScript.Shell");
  var path = "shutdown -r -f -t " + testr;
  shell.run(path,1,false);
  }
}

var 路径 = "shutdown -r -f -t " + testr