>omgr = GETOBJECT("WinMgmts:") >oadaptercol = omgr.InstancesOf("Win32_NetworkAdapterConfiguration") >IF oadaptercol.Count > 0 then > * go through each adapter configured on the system > FOR each oadapter in oadaptercol > if type("alen(oadapter.Properties_('IPAddress').Value)") = "N" then > * check was done to handle WAN adpaters that are configured on the > * system however they don't have IP addresses so disregard them > ? oadapter.Properties_('MACAddress').Value > for each cIP in oadapter.Properties_('IPAddress').Value > ? cIP > endfor > endif > ENDFOR >ENDIF >return>
>>>clear >>>local lcguid >>>lcguid = GetGUID() >>>return substr(lcguid,26,2)+'-'+substr(lcguid,28,2)+'-'+substr(lcguid,30,2); >>> +'-'+substr(lcguid,32,2)+'-'+substr(lcguid,34,2)+'-'+substr(lcguid,36,2) >>> >>>function GetGUID >>>local lcStrucGUID, lcGUID, lnsize >>>declare integer CoCreateGuid in Ole32.dll string @lcGUIDStruc >>>declare integer StringFromGUID2 in Ole32.dll string lcGUIDStruc, string @lcGUID, long lnSize >>> >>>lcStrucGUID=space(16) >>>lcGUID=space(80) >>>lnSize=40 >>> >>>if CoCreateGuid(@lcStrucGUID) # 0 then >>> return "" >>>endif >>>if StringFromGUID2(lcStrucGUID,@lcGuid,lnSize) = 0 then >>> return "" >>>endif >>>return strconv(left(lcGUID,76),6)>>>GetGUID code was posted by John Koziol (who I believe got it from Rick Strahl) here last year.