Jump to content
  • Advertisement
Sign in to follow this  
ramdy

getmac Windows command to get the system MACs

This topic is 2646 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello, I have been using for a while the "getmac" command to get the list of MACs in a Windows system and everything working Ok until I found recently a problem in some laptops where the command didn't work returning a message "Interface not compatible" (translation).

Before getmac I implemented the functionality through IPHLPAPI.DLL but later discovered it is not redistributable :D.

Thanks in advance,
Jorge R.

Share this post


Link to post
Share on other sites
Advertisement

Before getmac I implemented the functionality through IPHLPAPI.DLL but later discovered it is not redistributable :D.



Why does it matter whether it is redistributable? It's not like you're targeting Windows 98 Original Edition with Internet Explorer 4 or anything, is it?
I would just link against IPHLPAPI.DLL and assume that it's present on the target system, just like COMDLG32.DLL or USER32.DLL or whatever.

Share this post


Link to post
Share on other sites
However, since you don't distribute the dll you can't be 100% sure it is present and you may have also the problem of the dll version the user has installed (DLL hell). Anyway (after your suggestion), Im thinking to implement both together, if getmac fails, go through IPHLPAPI.DLL.

Thanks for help ;)

Share this post


Link to post
Share on other sites

If you don't like getmac, you can try parsing output of ipconfig /all

Looks like that way it would become OS language dependent.

Share this post


Link to post
Share on other sites

However, since you don't distribute the dll you can't be 100% sure it is present and you may have also the problem of the dll version the user has installed (DLL hell). Anyway (after your suggestion), Im thinking to implement both together, if getmac fails, go through IPHLPAPI.DLL.


These days, people tend to require version 6 of the common controls library, which shiped with Windows XP, and is not redistributable. On Windows 2000, or Windows ME, it is not there. However, in reality this is not a problem, because you simply say "windows xp or better required" and you're done. Nobody who is likely to download and use your program uses Windows ME or Windows 2000 anymore. Windows XP shipped more than 10 years ago!

You might as well worry about the system not having MMX available, or there not being more than 2 MB of VRAM, or not being more than 8 MB of system RAM...

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!