Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/388.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 即使在关闭hta后仍执行命令_Javascript_Vbscript_Hta - Fatal编程技术网

Javascript 即使在关闭hta后仍执行命令

Javascript 即使在关闭hta后仍执行命令,javascript,vbscript,hta,Javascript,Vbscript,Hta,我有一套cmd命令 @echo off ping 127.0.0.1 -n 10 netsh wlan stop hosted 如果我单击hta中的按钮,这些需要在后台执行,即使我关闭hta窗口,也不应该停止。即,hta存在,但上述代码在后台执行。我该怎么做呢?这可能会让你找到答案 <html> <head> <title>Ping Ping</title> <hta:application scr

我有一套cmd命令

@echo off
ping 127.0.0.1 -n 10
netsh wlan stop hosted

如果我单击hta中的按钮,这些需要在后台执行,即使我关闭hta窗口,也不应该停止。即,hta存在,但上述代码在后台执行。我该怎么做呢?

这可能会让你找到答案

<html>
    <head>
    <title>Ping Ping</title>
    <hta:application
         scroll="no"
         singleinstance="no"
         windowstate="normal"
    >
    </head>

<script type="text/vbscript">

Sub PingSub
  Dim WSHShell
  Dim ComputerName
  ComputerName = "127.0.0.1"

  Set WSHShell = CreateObject("WScript.Shell")
  WSHShell.Run("%comspec% /k ping " & ComputerName & " -t")
End Sub

</script>

<body>

<input id="btnBrowse" type="button" value="Run Pings..." onClick="PingSub" />

</body>
</html>

萍萍
亚平亚
昏暗的地狱
模糊计算机名
ComputerName=“127.0.0.1”
设置WSHShell=CreateObject(“WScript.Shell”)
WSHShell.Run(“%comspec%/k ping”&ComputerName&“-t”)
端接头