Need help with ethernet settings

G

Guest

Guest
Archived from groups: microsoft.public.win2000.registry,microsoft.public.windowsnt.registry (More info?)

For the sake of clarity I will give you a brief description of what im
doing, followed by the things i am stuck on. I am making a very small
application that will be given to about 2000 people on a large LAN. The
application needs to accomplish the following,
Set up the users ethernet connection to use DHCP
change some other settings, comp name, workgroup ( i already did this
part).
The program will need to work on win98 through XP, but for now I am just
worried about xp and 2k. I know how to retrieve and alter the registry
data, but I'm just not sure where to find what I need.

PROBLEM 1: I found where windows keeps the settings for each network
adapter. The only problem is that i dont have anyway of telling which
adapter is in use.

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows
NT\CurrentVersion\NetworkCards\ holds a key for each network card.
if I were to go into "Network Connections" in the cpanel I would only see
one LAN listed. In the registry here it shows ALL nic's i have ever used
even if they are not present. The one(s) I want are the ones that show up
as LAN or High speed internet under network connections. Does anyone have
an idea of how I can achieve this?

PROBLEM 2: Considering I "do" find the correct ethernet card. Given the
even that the user has for some reason or another manually specified an IP
address for the nic. I need to know how to tell if the IP the person has
was manually entered, or if it was obtained via DHCP. If it was manually
entered then I need to change the setting so that it will use DHCP for now
on.

Please note, that all of the above must be "automatic", assuming that a
large amount of the users will not know what a network card is.

Thanks!
 
G

Guest

Guest
Archived from groups: microsoft.public.win2000.registry,microsoft.public.windowsnt.registry (More info?)

d0x wrote:

> For the sake of clarity I will give you a brief description of what im
> doing, followed by the things i am stuck on. I am making a very small
> application that will be given to about 2000 people on a large LAN. The
> application needs to accomplish the following,
> Set up the users ethernet connection to use DHCP
> change some other settings, comp name, workgroup ( i already did this
> part).
> The program will need to work on win98 through XP, but for now I am just
> worried about xp and 2k. I know how to retrieve and alter the registry
> data, but I'm just not sure where to find what I need.
Hi

I would think Netsh.exe is an option (at least for Win2k/WinXP)...

How to Use the Netsh.exe Tool and Command-Line Switches
http://support.microsoft.com/default.aspx?scid=kb;EN-US;242468

Some examples:

For a Static IP use:
netsh interface ip set address "Local Area Connection" static 125.187.7.56
255.0.0.0

And for DHCP use:
netsh interface ip set address "Local Area Connection" DHCP

More here:

From: Jerry (jerry@hotmail.com)
Subject: Re: Change TCP/IP info on Win2k via VBScript
Newsgroups: microsoft.public.scripting.vbscript
Date: 2002-09-06 22:56:10 PST
http://groups.google.com/groups?selm=pTfe9.222885%24Yd.9091779%40twister.austin.rr.com

From: Jim de Graff (rjdegraff@hydro.mb.ca)
Subject: Re: Enable DHCP?
Newsgroups: microsoft.public.scripting.wsh,
microsoft.public.win2000.cmdprompt.admin
Date: 2002-09-16 12:48:43 PST
http://groups.google.com/groups?selm=%23cqQ7waXCHA.2404%40tkmsftngp10


--
torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway
Administration scripting examples and an ONLINE version of
the 1328 page Scripting Guide:
http://www.microsoft.com/technet/community/scriptcenter/default.mspx