A Windows Vista forum. Vista Banter

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.

Go Back   Home » Vista Banter forum » Microsoft Windows Vista » Networking with Windows Vista
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Networking with Windows Vista Networking issues and questions with Windows Vista. (microsoft.public.windows.vista.networking_sharing)

netsh to set IP address on vista..



 
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old February 10th 08, 04:26 PM posted to microsoft.public.windows.vista.networking_sharing
pdabak@yahoo.com
external usenet poster
 
Posts: 5
Default netsh to set IP address on vista..

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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 05:34 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.Search Engine Optimization by vBSEO 3.0.0 RC6
Copyright ©2004-2012 Vista Banter.
The comments are property of their posters.