Here is another way to get the SSID via the registry. Unfortunately I only have this one windows xp home computer to test this on, so it may not work in other environments.

 Code:
? GetCurrentSSID()
get $

Function GetCurrentSSID()
   $rootkey="HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class"
   for each $key in fEnumKey(@WkSta,$rootkey)
      if readvalue($rootkey+"\"+$key,"")="network adapters"
         for each $subkey in fEnumKey(@WkSta,$rootkey+"\"+$key)
            if len(readvalue($rootkey+"\"+$key+"\"+$subkey,"SSID"))>0
               $GetCurrentSSID=readvalue($rootkey+"\"+$key+"\"+$subkey,"SSID")
            endif
         next
      endif
   next
EndFunction

Function fEnumKey($Server, $Key)
   Dim $Index, $Error, $x
   $Index = 0
   Dim $KeyName[$Index]
   If $Server <> ""
      $Key = "\\" + $Server + "\" + $Key
   Endif
   If KeyExist($Key)
      Do
         $x = ENUMKEY($Key, $Index)
         $Error = @Error
         If NOT $Error and $Index > Ubound($KeyName)
            ReDim PRESERVE $KeyName[$Index]
         Endif
         If NOT $Error
            $KeyName[$Index] = $x
            $Index = $Index + 1
         Endif
      Until $Error
   Else
      $KeyName[0] = ""
      Exit 2
   Endif
   $fEnumKey = $KeyName
   Exit 0
Endfunction