Javascript 即使在关闭hta后仍执行命令
我有一套cmd命令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
@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”)
端接头