Jump to content

Vbscript Get WIFI SSID Windows 10


Recommended Posts

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

Link to comment
Share on other sites


Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

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