title: Problem with porting VBScript from WinXP to Win7
body: <p>The attached VBScript displays all available WiFi networks.<br>
  It works fine on WinXP, but doesn't work on Win7.
  On WinXP it shows a list of all available WiFi networks, however on WIn7 it shows an empty list.
  What is the problem?</p>
  
  <pre><code>on error resume next 
  set objSWbemServices = GetObject("winmgmts:\\.\root\wmi") 
  set colInstances = objSwbemServices.ExecQuery("SELECT * FROM MSNDis_80211_BSSIList") 
  for each obj in colInstances 
      if left(obj.InstanceName, 4) &lt;&gt; "WAN " and right(obj.InstanceName, 8)     &lt;&gt; "Miniport" then 
          for each rawssid in obj.Ndis80211BSSIList 
              ssid = "" 
              for i=0 to ubound(rawssid.Ndis80211SSid) 
                  decval = rawssid.Ndis80211Ssid(i) 
                  if (decval &gt; 31 AND decval &lt; 127) then 
                      ssid = ssid &amp; Chr(decval) 
                  end if 
              next 
              wscript.echo ssid 
          next 
      end if 
  next
  </code></pre>
  
  <p>I am a newbie with VBScript so please be gentle.</p>