![]() |
|
Welcome to Vista Banter. You are currently viewing our boards as a guest which gives you limited access to view most discussions, articles and access our other FREE features. By joining our free community you will have access to ask questions and reply to others posts, upload your own photos and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact contact support. |
|
|||||||
| Networking with Windows Vista Networking issues and questions with Windows Vista. (microsoft.public.windows.vista.networking_sharing) |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
Hello,
I need to set the IP address of the network adapter given it's MAC address. To do this I use GetAdaptersInfo API from IPHLPAPI.DLL to enumerate network adapters and then compare IP_ADAPTER_INFO.Address to the MAC address I am looking for. Once I get a match, I extract IP_ADAPTER_INFO.AdapterName and then I pass it to netsh command as follows netsh interface ip set address IP_ADAPTER_INFO.AdapterName static 10.6.36.159 255.255.0.0 10.6.0.1 1 The IP_ADAPTER_INFO.AdapterName is in the form of a GUID viz. {650B810A-0C51-4147-B1C4-0076A36B1C5A} This all works fine on Windows 2000/2003/XP. However on Vista, it fails with the following error. "The filename, directory name, or volume label syntax is incorrect." It seems that vista only supports specifying connection name viz. "Local Area Connection" and is not backward compatible. Now the question I have is: Is there any other way to map the MAC address OR AdapterName in GUID format to connection name? I know that its possible to do so through WMI, I want avoid using WMI. Since WMI is able to provide this mapping, there must be some way to do it. Thanks. -Prasad |
| Thread Tools | |
| Display Modes | |
|
|