PC Review


Reply
Thread Tools Rate Thread

Changing IP settings in registry

 
 
Leif Hauge
Guest
Posts: n/a
 
      19th Oct 2004
Hi !
Can someone help me figure out if this can be done ?
I want to run a command in a special made program that can change the LAN IP
to DHCP Enable by just clicking on it. It would work fine except LAN NIC's
have a unique ID in the registry edit. How can I avoid this ?

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\{Adapter}\
Parameters\Tcpip]

{Adapter} is a long string and is unique for the LAN NIC, is it possible to
find this key somehow by scripting or other ways ?

- Leif -
Norway


 
Reply With Quote
 
 
 
 
Dave Patrick
Guest
Posts: n/a
 
      19th Oct 2004
You might try netsh from a command prompt;

1 to set ip address and subnet, 2 to clear previous dns server ip's, 3 to
set primary dns server, 4 to set alt dns server, 5 to set ip address DHCP
assigned

1.) netsh interface ip set address name="Local Area Connection 2"
source=static addr=192.168.10.10 mask=255.255.255.0 gateway=none
2.) netsh interface ip delete dns name="Local Area Connection 2" addr=all
3.) netsh interface ip set dns name="Local Area Connection 2" source=static
addr=192.168.20.20
4.) netsh interface ip add dns name="Local Area Connection 2"
addr=192.168.30.30
5.) netsh interface ip set address name="Local Area Connection 2"
source=dhcp

Where "Local Area Connection 2" is the name of your connection. (watch for
line wrap)


--
Regards,

Dave Patrick ....Please no email replies - reply in newsgroup.
Microsoft Certified Professional
Microsoft MVP [Windows]
http://www.microsoft.com/protect

"Leif Hauge" wrote:
| Hi !
| Can someone help me figure out if this can be done ?
| I want to run a command in a special made program that can change the LAN
IP
| to DHCP Enable by just clicking on it. It would work fine except LAN NIC's
| have a unique ID in the registry edit. How can I avoid this ?
|
| [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\{Adapter}\
| Parameters\Tcpip]
|
| {Adapter} is a long string and is unique for the LAN NIC, is it possible
to
| find this key somehow by scripting or other ways ?
|
| - Leif -
| Norway
|
|


 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Changing display settings via registry =?Utf-8?B?SGlyZW4gTWVodGE=?= Windows Vista Hardware 11 5th Jun 2007 08:07 AM
What keeps changing My Registry IE Settings Trip Windows XP General 2 3rd Jul 2006 01:11 AM
What registry settings and/or file settings are modified when changing options? richard Spyware Discussion 3 22nd Mar 2005 05:28 PM
Changing IP settings in registry Leif Hauge Microsoft Windows 2000 Registry 1 19th Oct 2004 09:49 PM
Re: Remotely changing registry settings Jerold Schulman Microsoft Windows 2000 Registry Archive 0 30th Jun 2003 02:26 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:55 PM.