Re: Modifying IP address by modifying the registry programatically

From: Bijesh.V.M. (bijesh_vm@hotmail.com)
Date: 08/13/02


From: bijesh_vm@hotmail.com (Bijesh.V.M.)
Date: 12 Aug 2002 22:38:12 -0700

Hi Kent,

I tried the netsh command in XP. It worked properly and I am planning
to
invoke that from my program for modifying the IP address. Thanks a
lot.

I have certain doubts with regard to the "netsh" command. Here are the
experimental steps done by me.

(1) Used the "netsh -c interface dump > p.txt" for copying the network
configuration information to the file.
(2) Modified the IP address in the file by editing it.
(3) Used the "netsh -f p.txt" command for setting the updated config
information.

Now, the new IP address is set for the machine (let it be Machine A).
I checked this by
pinging the new IP address from another machine (Machine B)in the
network. It
worked.

But, when I pinged using the host name instead of IP address, it
failed.

Here is the info with respect to the steps undertaken after the host
name ping failure:
       (a) I tried the "netconfig flushdns" command for updating the
DNS
           cache of the machine (Machine B). But the hostname pinging
failed
           again.
       (b) I tried the "netconfig registerdns" also, and then pinged
again, but with negative result.
       (c) I tried the pinging after restarting Machine B, it was
           successful.
       (d) Also I got pinging successful without any restart, when I
tried
           ping after about 20 minutes.

Now I came to the following conclusions
       (a) Netsh command makes it possible to change the IP address
without
           restarting the machine.
       (b) But the changed IP address and its association with the
host name is not updated to the rest of the machines in the network.
       (c) Every machine in the network updates the IP configuration
           periodically
 
Here are my further queries.
(1) Could you provide the details on, where to look for information
regarding the DNS cache flushing and related things. Any site?
(2) Also, Is there any command similar to "netsh" in Windows NT 4.0?

Thanx in advance.

Bijesh"Kent W. England [MVP]" <kwe@mvps.org> wrote in message news:<Ognb6yXQCHA.2688@tkmsftngp13>...
> I didn't correlate this thread with any other. So long as he understands
> that netsh is there if he needs it ...
>
> --
> Kent W. England, MS MVP for Windows XP
> (Please respond only in the newsgroup)
>
> Roger Abell [MVP] <mvpNOSPAM@asu.edu> wrote:
>
> > "Kent W. England [MVP]" <kwe@mvps.org> wrote in message
> > news:eNM30i0PCHA.1648@tkmsftngp08...
> > netsh interface /?
> >
> > --
> > Kent W. England, MS MVP for Windows XP
> >
> > I totally agree Kent, but Bijesh seems to have rejected
> > the mention of using netsh made in his earlier thread.
> > netsh would be the way to avoid the interactions of
> > the reg keys.



Relevant Pages

  • Re: statische ip-adresse vergeben
    ... How to Use the NETSH Command to Change from Static IP Address to DHCP ... Replace ipaddr with the static IP address, subnetmask with the ...
    (microsoft.public.de.german.win2000.networking)
  • Re: Change IP configuration with just run a file
    ... I want to change the IP configuration on a Windows ... Use the "netsh" command in a batch file. ... This Microsoft Knowledge Base article has details of the Windows 2000 ...
    (microsoft.public.windowsxp.network_web)
  • Re: networking problem
    ... netsh extensions hoping that it will depend on the core networking ... Network Command Shell ... Command Shell Interface Context ...
    (microsoft.public.windowsxp.embedded)
  • Re: Getmac reports ERROR Provider type not defined.
    ... Do you use you customer script to work with netsh? ... Just in case you use "Local Area Network" interface name there, make sure to register the name first with command like: ... >> Network Command Shell Interface Context ...
    (microsoft.public.windowsxp.embedded)
  • Re: Modifying IP address by modifying the registry programatically
    ... Kent W. England, MS MVP for Windows XP ... but Bijesh seems to have rejected ... the mention of using netsh made in his earlier thread. ...
    (microsoft.public.windowsxp.security_admin)