/* Returns the name of the currently connected wifi SSID. Returns an empty string if not connected to wifi */ comBowenwebUtilityNetworking_getWifiSSID() { ;MsgBox, It's working! dhw := A_DetectHiddenWindows DetectHiddenWindows On Run "%ComSpec%" /k,, Hide, pid while !(hConsole := WinExist("ahk_pid" pid)) Sleep 10 DllCall("AttachConsole", "UInt", pid) DetectHiddenWindows %dhw% objShell := ComObjCreate("WScript.Shell") objExec := objShell.Exec("cmd /c netsh wlan show interface") While !objExec.Status Sleep 100 wlanres := objExec.StdOut.ReadAll() DllCall("FreeConsole") Process Exist, %pid% if (ErrorLevel == pid) Process Close, %pid% RegExMatch(wlanres,"\sSSID\s+:\s(.+)",m) ssid := m1 return ssid }