SSID active from Windows 7
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?
Thanks
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?
Thanks
'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))
Next
SSID = ID
Next
End Function
wscript.echo SSID()
0 Comments
[ + ] Show comments
Answers (0)
Please log in to answer
Be the first to answer this question
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
so that the conversation will remain readable.