Home All Groups Group Topic Archive Search About

NETSH command doesnt work???

Author
28 May 2009 1:25 PM
BertieBigBollox@gmail.com
Got a script that runs automatically to set the IP address of my
win2000 servers.

It uses the following command:-

netsh interface ip set address local static <IP address> <netmask>
<default gateway> 1

Doesnt give an error but does nothing. Leaves IP as 0.0.0.0.

If I go into network connections, I can change the IP from there but I
need to be able to run from script.

Author
28 May 2009 2:42 PM
Pegasus [MVP]
<BertieBigBol***@gmail.com> wrote in message
news:7a90e0dd-389c-4cc3-b563-8a9eb6f881d7@g37g2000yqn.googlegroups.com...
> Got a script that runs automatically to set the IP address of my
> win2000 servers.
>
> It uses the following command:-
>
> netsh interface ip set address local static <IP address> <netmask>
> <default gateway> 1
>
> Doesnt give an error but does nothing. Leaves IP as 0.0.0.0.
>
> If I go into network connections, I can change the IP from there but I
> need to be able to run from script.

To avoid ambiguities, you should specify the name of the connection you wish
to modify, e.g. like so:

netsh interface ip set address name="wireless pcmcia"  static
  192.168.1.44  255.255.255.0 192.168.1.2 1
Are all your drivers up to date? click for free checkup

Author
28 May 2009 4:04 PM
BertieBigBollox@gmail.com
Show quote Hide quote
On May 28, 3:42 pm, "Pegasus [MVP]" <n***@microsoft.com> wrote:
> <BertieBigBol***@gmail.com> wrote in message
>
> news:7a90e0dd-389c-4cc3-b563-8a9eb6f881d7@g37g2000yqn.googlegroups.com...
>
> > Got a script that runs automatically to set the IP address of my
> > win2000 servers.
>
> > It uses the following command:-
>
> > netsh interface ip set address local static <IP address> <netmask>
> > <default gateway> 1
>
> > Doesnt give an error but does nothing. Leaves IP as 0.0.0.0.
>
> > If I go into network connections, I can change the IP from there but I
> > need to be able to run from script.
>
> To avoid ambiguities, you should specify the name of the connection you wish
> to modify, e.g. like so:
>
> netsh interface ip set address name="wireless pcmcia"  static
>   192.168.1.44  255.255.255.0 192.168.1.2 1

So what does LOCAL do?
Author
28 May 2009 4:05 PM
BertieBigBollox@gmail.com
Show quote Hide quote
On May 28, 3:42 pm, "Pegasus [MVP]" <n***@microsoft.com> wrote:
> <BertieBigBol***@gmail.com> wrote in message
>
> news:7a90e0dd-389c-4cc3-b563-8a9eb6f881d7@g37g2000yqn.googlegroups.com...
>
> > Got a script that runs automatically to set the IP address of my
> > win2000 servers.
>
> > It uses the following command:-
>
> > netsh interface ip set address local static <IP address> <netmask>
> > <default gateway> 1
>
> > Doesnt give an error but does nothing. Leaves IP as 0.0.0.0.
>
> > If I go into network connections, I can change the IP from there but I
> > need to be able to run from script.
>
> To avoid ambiguities, you should specify the name of the connection you wish
> to modify, e.g. like so:
>
> netsh interface ip set address name="wireless pcmcia"  static
>   192.168.1.44  255.255.255.0 192.168.1.2 1

Also, still doesnt work even if I use the interface name. Appears to
work and comes back OK though.
Author
28 May 2009 4:38 PM
Pegasus [MVP]
<BertieBigBol***@gmail.com> wrote in message
Show quoteHide quote
news:97a31aec-1820-4108-b7c3-2d1ffde53d95@h2g2000yqg.googlegroups.com...
On May 28, 3:42 pm, "Pegasus [MVP]" <n***@microsoft.com> wrote:
> <BertieBigBol***@gmail.com> wrote in message
>
> news:7a90e0dd-389c-4cc3-b563-8a9eb6f881d7@g37g2000yqn.googlegroups.com...
>
> > Got a script that runs automatically to set the IP address of my
> > win2000 servers.
>
> > It uses the following command:-
>
> > netsh interface ip set address local static <IP address> <netmask>
> > <default gateway> 1
>
> > Doesnt give an error but does nothing. Leaves IP as 0.0.0.0.
>
> > If I go into network connections, I can change the IP from there but I
> > need to be able to run from script.
>
> To avoid ambiguities, you should specify the name of the connection you
> wish
> to modify, e.g. like so:
>
> netsh interface ip set address name="wireless pcmcia" static
> 192.168.1.44 255.255.255.0 192.168.1.2 1

Also, still doesnt work even if I use the interface name. Appears to
work and comes back OK though.

=================

Worked perfectly for me, running WinXP Professional.
Author
29 May 2009 8:32 AM
BertieBigBollox@gmail.com
Show quote Hide quote
On May 28, 5:38 pm, "Pegasus [MVP]" <n***@microsoft.com> wrote:
> <BertieBigBol***@gmail.com> wrote in message
>
> news:97a31aec-1820-4108-b7c3-2d1ffde53d95@h2g2000yqg.googlegroups.com...
> On May 28, 3:42 pm, "Pegasus [MVP]" <n***@microsoft.com> wrote:
>
>
>
>
>
> > <BertieBigBol***@gmail.com> wrote in message
>
> >news:7a90e0dd-389c-4cc3-b563-8a9eb6f881d7@g37g2000yqn.googlegroups.com....
>
> > > Got a script that runs automatically to set the IP address of my
> > > win2000 servers.
>
> > > It uses the following command:-
>
> > > netsh interface ip set address local static <IP address> <netmask>
> > > <default gateway> 1
>
> > > Doesnt give an error but does nothing. Leaves IP as 0.0.0.0.
>
> > > If I go into network connections, I can change the IP from there but I
> > > need to be able to run from script.
>
> > To avoid ambiguities, you should specify the name of the connection you
> > wish
> > to modify, e.g. like so:
>
> > netsh interface ip set address name="wireless pcmcia" static
> > 192.168.1.44 255.255.255.0 192.168.1.2 1
>
> Also, still doesnt work even if I use the interface name. Appears to
> work and comes back OK though.
>
> =================
>
> Worked perfectly for me, running WinXP Professional.- Hide quoted text -
>
> - Show quoted text -

Think its specific to this machine. Script works fine on other
servers. Got no idea why it fails on this,,,
Author
28 May 2009 5:39 PM
Pegasus [MVP]
<BertieBigBol***@gmail.com> wrote in message
Show quoteHide quote
news:97a31aec-1820-4108-b7c3-2d1ffde53d95@h2g2000yqg.googlegroups.com...
On May 28, 3:42 pm, "Pegasus [MVP]" <n***@microsoft.com> wrote:
> <BertieBigBol***@gmail.com> wrote in message
>
> news:7a90e0dd-389c-4cc3-b563-8a9eb6f881d7@g37g2000yqn.googlegroups.com...
>
> > Got a script that runs automatically to set the IP address of my
> > win2000 servers.
>
> > It uses the following command:-
>
> > netsh interface ip set address local static <IP address> <netmask>
> > <default gateway> 1
>
> > Doesnt give an error but does nothing. Leaves IP as 0.0.0.0.
>
> > If I go into network connections, I can change the IP from there but I
> > need to be able to run from script.
>
> To avoid ambiguities, you should specify the name of the connection you
> wish
> to modify, e.g. like so:
>
> netsh interface ip set address name="wireless pcmcia" static
> 192.168.1.44 255.255.255.0 192.168.1.2 1

Also, still doesnt work even if I use the interface name. Appears to
work and comes back OK though.

==============

Please post the following:
a) The exact command you used.
b) The full output from the command
     ipconfig  /all
Author
28 May 2009 2:43 PM
BertieBigBollox@gmail.com
On May 28, 2:25 pm, "BertieBigBol***@gmail.com"
<BertieBigBol***@gmail.com> wrote:
> Got a script that runs automatically to set the IP address of my
> win2000 servers.
>
> It uses the following command:-
>
> netsh interface ip set address local static <IP address> <netmask>
> <default gateway> 1
>
> Doesnt give an error but does nothing. Leaves IP as 0.0.0.0.
>
> If I go into network connections, I can change the IP from there but I
> need to be able to run from script.

Have tried completely uninstalling the network interfaces and
reinstalling but still the same.

Strangely enough, it listed the interfaces as Local Area Interface 2
and 3 again. Whats happened to 1? IS there something in the registry
or something deciding that theres aleady a LAN 1?

Bookmark and Share