0

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

<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 格式正确传递变量

4

1 回答 1

0

这是在 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 path = "关机 -r -f -t" + testr

于 2020-02-23T06:56:22.350 回答