Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: need help on NETSH command  (Read 2716 times)

0 Members and 1 Guest are viewing this topic.

wizmerlin

  • Guest
need help on NETSH command
« on: May 09, 2007, 12:27:16 AM »
my OS is Windows XP
i saw this sample on http://www.computerhope.com/netsh.htm

set address name="Local Area Connection" source=dhcp

this command Sets the "Local Area Connection" to DHCP.

when i tested this command there was a problem.

this is the result on the MS DOS prompt:

C:\>netsh
netsh>set address name="Local Area Connection" source=dhcp
The following command was not found: set address name="Local Area Connection" source=dhcp.


the red part is the error.
anyone know what is the problem?

GuruGary



    Adviser
    Re: need help on NETSH command
    « Reply #1 on: May 09, 2007, 12:39:59 AM »
    Is your connection called "Local Area Connection"?  Look at your network properties, or run IPCONFIG to see your connection names.  It may be called "Local Area Connection 2" or "Wireless Connection" or something else.

    If that's not the problem, then we can look at your syntax.

    wizmerlin

    • Guest
    Re: need help on NETSH command
    « Reply #2 on: May 09, 2007, 12:47:49 AM »
    when i typed ipconfig

    Ethernet adapter Local Area Connection:

     Connection-specific DNS Suffix  . :
     IP Address. . . . . . . . . . . . : 192.168.10.106
     Subnet Mask . . . . . . . . . . . : 255.255.255.0
     Default Gateway . . . . . . . . . : 192.168.1.10

    contrex

    • Guest
    Re: need help on NETSH command
    « Reply #3 on: May 09, 2007, 02:53:19 AM »
    I found this on the MS netsh page

    Quote
    For these commands to work at the Windows XP command prompt, you must type netsh interface ip before typing commands

    netsh interface ip set address "Local Area Connection" dhcp


    wizmerlin

    • Guest
    Re: need help on NETSH command
    « Reply #4 on: May 11, 2007, 12:54:45 AM »
    thank you contrex.
    i works.

    is there a way that i dont need to specify the name of the connection?
    example:

    netsh interface ip set address * dhcp

    where it can automatically identify the name of the address which is Local Area Connection.

    contrex

    • Guest
    Re: need help on NETSH command
    « Reply #5 on: May 11, 2007, 01:00:19 AM »
    Batch files can do many things, but if you want one that reads your mind you'll have to wait a while...  :)

    GuruGary



      Adviser
      Re: need help on NETSH command
      « Reply #6 on: May 11, 2007, 01:23:47 AM »
      You could write a FOR loop that uses IPCONFIG or NETSH to list the adapters, and netsh interface ip set address "%%a" dhcp for each connection it finds.