This code will set an environment variable called BBSID that you can use environment variable conditions with to detect which wireless access point you are connected to. This is useful for detecting where a laptop might be for location based printing and such.
Set WshShell = WScript.CreateObject("WScript.Shell")
Set oUserEnv = WshShell.Environment("USER")
Set oExec = WshShell.Exec("netsh wlan show interfaces")
Output = oExec.StdOut.ReadAll
If Instr(Output, " State : disconnected") > 0 Then
oUserEnv("BSSID") = "Disconnected"
Lines = Split(Output, vbcrlf)
For Each Line in Lines
If Instr(Line, "BSSID") > 0 Then
'Msgbox Trim(Mid(Line, Instr(line, ":") +1 ))
oUserEnv("BSSID") = Trim(Mid(Line, Instr(line, ":") +1 ))