0

This hta program list name of wlan ssid. I want to hide command prompt popping up when using objshell.Exec(). How to do this without creating a temporary text document? Is there any way using objshell.Run() function?

     <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>
user2689288
  • 33
  • 1
  • 2
  • 10
  • see http://stackoverflow.com/a/4963209/603855 – Ekkehard.Horner Sep 04 '13 at 17:07
  • possible duplicate of [VBscript code to capture stdout, without showing console window](http://stackoverflow.com/questions/4919573/vbscript-code-to-capture-stdout-without-showing-console-window). Basically you can either use `Run` with temporary files and have a hidden window, or `Exec` and have a window popping up briefly. – Ansgar Wiechers Sep 04 '13 at 18:12

0 Answers0