如何隐藏命令提示符在gta中弹出?

时间:2013-09-04 16:27:33

标签: vbscript hta

这个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>

0 个答案:

没有答案