11-20-2009 07:31 AM
I need to be able to find the mac address on windows computers running my code. I have seen the vi get_remote_mac_address that uses the ipconfig /all command and parses the result to find the mac address.
The problem with this vi is that it looks for the string "Physical Address" to find the location of the mac address. This string is not the same on windows system with different language, for example on a German version of Windows XP the string is "Physikalische Adresse".
To get around this problem I made a new vi that looks for a mac address pattern in the ipconfig /all result and returns all mac addresses it finds.
My question is: Does anybody have experience with getting the mac address on computers with non English Windows? Or if anybody could test the attached vi to see how it works on different language versions of windows and post back the results.
Thank you,
Thorarinn Andresson
11-20-2009 08:04 AM
11-20-2009 01:29 PM - edited 11-20-2009 01:29 PM
You can use .NET to retrieve the NetworkInterface.PhysicalAddress property.
11-20-2009 04:03 PM
11-23-2009 04:59 AM
I appreciate all the suggestions.
Rolf Kalbermatter, do you know how your library works on different version of Windows? I have tested it on XP, Vista & Windows Server 2003 and it works well, on Windows Vista the vi returned more results then the ipconfig /all command. I have not been able to test it on Windows 7 or Windows Server 2008.
Best Regards,
Thorarinn.
11-23-2009 05:04 AM - edited 11-23-2009 05:05 AM
I have not tested it on newer Windows versions myself. However I would not expect it to not work except of privilege reasons. I could imagine that some of those APIs might require special privileges in VISTA and Windows 7. So try it with standard user rights to be sure.
And since .Net most likely makes use of the same low level APIs at some point I would expect it to have similar privilege trouble if there are any.
11-23-2009 06:56 AM
rolfk wrote:I hate .Net
For anyone not wanting to involve 5 software layers to do this there is also a solution here.
I almost prefaced my post with "There are those that will hate the fact that I'm suggesting .NET, but..."
I like Windows XP over Vista or Win7, but the day will come when I will be dragged kicking and screaming to it...
The dark side is strong Rolf, do not resist it.... 😄
11-23-2009 08:05 AM
@Phillip Brooks wrote:
I almost prefaced my post with "There are those that will hate the fact that I'm suggesting .NET, but..."
I like Windows XP over Vista or Win7, but the day will come when I will be dragged kicking and screaming to it...
The dark side is strong Rolf, do not resist it.... 😄
We must resist assimilation!
And even Windows 7 is still DLL API based in its core. I guess at some point MS will cease documenting new APIs on lower than .Net level but in the bowls of Windows there is still a Windows kernel using syscalls and being interfaced through DLLs. I also don't see .Net kernel drivers happening anytime soon.