此 hta 程序列出 wlan ssid 的名称。我想隐藏使用 objshell.Exec() 时弹出的命令提示符。如何在不创建临时文本文档的情况下做到这一点?有没有办法使用 objshell.Run() 函数?
<script language="VBScript" type="text/vbscript">
sub StartPrevious
set objShell = CreateObject("WScript.Shell")
cmdarg="%comspec% /c netsh wlan show hosted"
iReturn=objShell.Run(cmdarg, 0, True)
If iReturn = 0 Then
set objExCmd=objShell.Exec ("netsh wlan show hosted")
strContents =objExCmd.StdOut.ReadAll
Set objRegEx = New RegExp
objRegEx.IgnoreCase = True
objRegEx.Global = True
objRegEx.Multiline = True
objRegEx.Pattern = """([^""]+)"""
set colMatches = objRegEx.Execute(strContents)
For each objMatch in colMatches
MsgBox "SSID name: " & objMatch.Value
Next
End If
end sub
</script>