Jump to content

Recommended Posts

Posted

Hello All.

I am looking for a script that can get the SSID of the wifi network the pc is connected to. I want to write a script that checks if the pc is connected to a specific network and if it is then do something. I found many scripts but they all return blank for SSID

on error resume nextPrivate 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 SubFunction 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   NextEnd Functionwscript.echo SSID()

I dont know why it blank please help me


Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...