Hi all,
I need to know the name SSID that a machine is conected for later run other script if the name is correct.
I got this script from internet that work well for windows xp but not for windows 7 64 bits.
Somebody knows why fail?

'on error resume next
Private Sub GetWMI(WMIArray, WMIQuery)
' On error resume Next
Set WMIClass = GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\wmi")

If not(WMIClass is nothing) Then
Set WMIArray = WMIClass.ExecQuery(WMIQuery)

end if
End Sub

Function SSID()
' On error resume Next

Call GetWMI(objMSNdis_80211_ServiceSetIdentifierSet, "Select * from MSNdis_80211_ServiceSetIdentifier Where active=true")

For Each objMSNdis_80211_ServiceSetIdentifier in objMSNdis_80211_ServiceSetIdentifierSet
ID = ""

For i = 0 to objMSNdis_80211_ServiceSetIdentifier.Ndis80211SsId(0)
ID = ID & chr(objMSNdis_80211_ServiceSetIdentifier.Ndis80211SsId(i + 4))


End Function

wscript.echo SSID()
0 Comments   [ - ] Hide Comments


Please log in to comment

There are no answers at this time
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
Answer this question or Comment on this question for clarity