Hi all, According to my research, the equivalent of gethostid() on Windows is the IPXAddress member of the Win32_NetworkAdapterConfiguration class. You can see the equivalent if you type "ipconfig /all" and look at the "Physical Address" member. However, the MSDN docs say that the IPXAddress member is no longer valid on Windows Vista and later. Does anyone know how to get the hostid on Vista and later? Thanks, Dan
Hi Dan, I did a little research, and found the following code that''s supposed to do this on Vista, although I didn''t try running it myself: http://www.codeproject.com/KB/IP/Net_Adapter_Info_in_C_.aspx Since it''s C# .NET code it probably isn''t exactly what you''re looking for, but maybe it will point out directions for further investigation. (Of course, on Vista, .NET 3.0 is always present.) Wayne On Sat, Jun 21, 2008 at 6:49 PM, Daniel Berger <djberg96 at gmail.com> wrote:> Hi all, > > According to my research, the equivalent of gethostid() on Windows is the > IPXAddress member of the Win32_NetworkAdapterConfiguration class. You can > see the equivalent if you type "ipconfig /all" and look at the "Physical > Address" member. > > However, the MSDN docs say that the IPXAddress member is no longer valid on > Windows Vista and later. Does anyone know how to get the hostid on Vista and > later? > > Thanks, > > Dan > _______________________________________________ > win32utils-devel mailing list > win32utils-devel at rubyforge.org > http://rubyforge.org/mailman/listinfo/win32utils-devel >
Hi, ----- Original Message ----- From: "Daniel Berger" <djberg96 at gmail.com> To: "Development and ideas for win32utils projects" <win32utils-devel at rubyforge.org> Sent: Sunday, June 22, 2008 10:49 AM Subject: [Win32utils-devel] hostid on Windows Vista and later> Hi all, > > According to my research, the equivalent of gethostid() on Windows is the > IPXAddress member of the Win32_NetworkAdapterConfiguration class. You can > see the equivalent if you type "ipconfig /all" and look at the "Physical > Address" member. > > However, the MSDN docs say that the IPXAddress member is no longer valid > on Windows Vista and later. Does anyone know how to get the hostid on > Vista and later? >Why do you need IPXAddress member? As I know, the IPX protocol is not installed by default on XP and 2003. In my test IPXAdress is just same to MACAddress and MACAddress member works on Vista. Following script works on XP, 2003 and Vista: strComputer = "." Set objWMIService = GetObject("winmgmts:\\" _ & strComputer & "\root\CIMV2") Set colItems = objWMIService.ExecQuery( _ "SELECT * FROM Win32_NetworkAdapterConfiguration where IPEnabled=true",,48) For Each objItem in colItems Wscript.Echo "MACAddress: " & objItem.MACAddress Next Regards, Park Heesob
On Sat, Jun 21, 2008 at 9:34 PM, Park Heesob <phasis at gmail.com> wrote:> Hi, > ----- Original Message ----- > From: "Daniel Berger" <djberg96 at gmail.com> > To: "Development and ideas for win32utils projects" > <win32utils-devel at rubyforge.org> > Sent: Sunday, June 22, 2008 10:49 AM > Subject: [Win32utils-devel] hostid on Windows Vista and later > > >> Hi all, >> >> According to my research, the equivalent of gethostid() on Windows is the >> IPXAddress member of the Win32_NetworkAdapterConfiguration class. You can >> see the equivalent if you type "ipconfig /all" and look at the "Physical >> Address" member. >> >> However, the MSDN docs say that the IPXAddress member is no longer valid >> on Windows Vista and later. Does anyone know how to get the hostid on >> Vista and later? >> > Why do you need IPXAddress member? As I know, the IPX protocol is not > installed by default on XP and 2003. > In my test IPXAdress is just same to MACAddress and MACAddress member works > on Vista. > Following script works on XP, 2003 and Vista: > > strComputer = "." > Set objWMIService = GetObject("winmgmts:\\" _ > & strComputer & "\root\CIMV2") > Set colItems = objWMIService.ExecQuery( _ > "SELECT * FROM Win32_NetworkAdapterConfiguration where > IPEnabled=true",,48) > For Each objItem in colItems > Wscript.Echo "MACAddress: " & objItem.MACAddress > Next > > Regards, > > Park HeesobAh, silly me, I missed that. Thanks, Dan PS - This is for the sys-host library