Results 1 to 4 of 4

Thread: How to Use the Netsh.exe and NETSH Command to Change from Static IP in win2000

  1. #1
    Join Date
    Dec 2008
    Posts
    207

    How to Use the Netsh.exe and NETSH Command to Change from Static IP in win2000

    hi ,
    i am interesting to have information about Netsh.exe Tool. Mainly i want to know how to Change Static IP Address to DHCP by Using the NETSH Command in Windows 2000.and also tell me how to Use the Netsh.exe Tool and Command-Line Switches .
    thank you.

  2. #2
    Join Date
    May 2008
    Posts
    2,134

    Re: How to Use the Netsh.exe and NETSH Command to Change from Static IP in win2000

    hi , i think this will works for you,

    the Netsh.exe Tool and Command-Line Switches
    Netsh.exe is a tool an administrator can use to configure and monitor Windows-based computers at a command prompt. With the Netsh.exe tool, you can direct the context commands you enter to the appropriate helper, and the helper then carries out the command.

    You can use the Netsh.exe tool to perform the following tasks:

    * Configure interfaces.
    * Configure routing protocols.
    * Configure filters.
    * Configure routes.
    * Configure remote access behavior for Windows-based remote access routers that are running the Routing and Remote Access Server (RRAS) Service.
    * Display the configuration of a currently running router on any computer.
    * Use the scripting feature to run a collection of commands in batch mode against a specified router.

    The syntax for the Netsh.exe tool is:
    netsh [-r router name] [-a AliasFile] [-c Context] [Command | -f ScriptFile]
    To display a list of subcontexts and commands that can be used in a context, type the context name followed by a space and a ? at the netsh> command prompt. For example, to display a list of subcontext and commands that can be used in the /routing context, type routing ? at the netsh> command prompt, and then press ENTER.

    Contexts
    Context strings are appended to the Netsh.exe tool command and are passed to an associated helper. The helper may have one or more entry points that map to contexts. Some of the contexts available in the Netsh.exe tool are:

    Context Command: /dhcp
    Result: Changes to the Dynamic Host Configuration Protocol (DHCP) context.

    Context Command: /ras
    Result: Changes to the Remote Access Server (RAS) context.

    Context Command: /routing
    Result: Changes to the routing context.

    Context Command: /wins
    Result: Changes to the Windows Internet Name Service (WINS) context.

    Contexts may also nest within other contexts. For example, the following contexts operate within the netsh>ras context:

    Context Command: /ip
    Result: Changes to the Internet Protocol (IP) context.

    Context Command: /ipx
    Result: Changes to the Internetwork Packet Exchange (IPX) context.

    Context Command: /netbeui
    Result: Changes to the NetBios Enhanced User Interface (NETBEUI) context.

    The following subcontexts operate within the netsh>routing ip context:

    Context Command: /autodhcp
    Result: Changes to the autodhcp subcontext.

    Context Command: /dnsproxy
    Result: Changes to the dnsproxy subcontext.

    Context Command: /igmp
    Result: Changes to the Internet Group Membership Protocol (IGMP) subcontext.

    Context Command: /mib
    Result: Changes to the Management Information Base (MIB) subcontext.

    Context Command: /nat
    Result: Changes to the Network Address Translation (NAT) subcontext.

    Context Command: /ospf
    Result: Changes to the Open Shortest Path First (OSPF) subcontext.

    Context Command: /relay
    Result: Changes to the relay subcontext.

    Context Command: /rip
    Result: Changes to the Routing Information Protocol (RIP) subcontext.


    Netsh.exe Commands
    The following additional commands can be used with the Netsh.exe tool:

    NOTE: Optional parameters are shown in brackets ([ ]). Alternative entries are shown with a pipe (|) character between them.

    Context Command: /?
    Result: Displays help.

    Context Command: /abort
    Result: Discards any changes made in offline mode. No effect in online mode.

    Context Command: /add helper DLL-name
    Result: Installs the helper .dll file in netsh.exe.

    Context Command: /alias [alias-name] [string1] [string2 ...]
    Result: If /alias, lists all aliases. If /alias alias-name, displays the equivalent string. If /alias alias-name string1 string2 ..., sets alias-name to the specified strings.

    Context Command: /bye
    Result: Exits the program.

    Context Command: /commit
    Result: Commits any changes made in the offline mode to the router. No effect in the online mode.

    Context Command: /delete helper .dll file name
    Result: Removes the helper .dll file from Netsh.exe.

    Context Command: /dump -file name
    Result: Dumps or appends configuration to a text file.

    Context Command: /exec script file name
    Result: Loads the script file and executes commands from it.

    Context Command: /exit
    Result: Exits the program.

    Context Command: /h
    Result: Displays help.

    Context Command: /help
    Result: Displays help.

    Context Command: /offline
    Result: Sets the current mode to offline. Any changes made in this mode are saved, but require a "commit" or "online" command to be set in the router.

    Context Command: /online
    Result: Sets the current mode to online. Any changes in this mode are immediately reflected in the router.

    Context Command: /popd
    Result: Pops a context from the stack.

    Context Command: /pushd
    Result: Pushes current context onto the stack.

    Context Command: /quit
    Result: Exits the program.

    Context Command: /set mode [mode =] online | offline
    Result: Sets the current mode to online or offline.

    Context Command: /show alias | helper | mode
    Result: If /show alias, lists all defined aliases. If /show helper, lists all top-level helpers. If /show mode, shows the current mode.

    Context Command: /unalias alias name
    Result: Deletes the specified alias.


    Helper Dynamic Link Libraries Files Available
    Routing & Remote Access IP Configuration - Ipmontr.dll
    Routing & Remote Access IPX Configuration - Ipxmontr.dll
    Interface - Ifmon.dll
    RAS - Rasmontr.dll
    DHCP - Dhcpmon.dll
    WINS - Winsmon.dll

    Associated Registry Entries for Helper Dynamic Link Libraries Files
    HKEY_LOCAL_MACHINE/Software/Microsoft/NetSh/
    REG_SZ: Ipmontr.dll
    REG_SZ: Ipxmontr.dll
    REG_SZ: Ifmon.dll
    REG_SZ: Rasmontr.dll
    REG_SZ: Dhcpmon.dll
    REG_SZ: Winsmon.dll


    NOTE: If attempts to use Netsh dump -<file name> to dump configurations to a file does not work, try using the syntax: netsh dump >filename or path\filename, from a command line.


    Useful for
    * Microsoft Windows 2000 Server
    * Microsoft Windows 2000 Advanced Server
    * Microsoft Windows 2000 Professional Edition
    * Microsoft Windows 2000 Datacenter Server
    Last edited by johnson22; 01-01-2009 at 04:54 PM.

  3. #3
    Join Date
    May 2008
    Posts
    2,134

    Re: How to Use the Netsh.exe and NETSH Command to Change from Static IP in win2000

    NETSH Command to Change from Static IP Address to DHCP in Windows 2000

    You can use the netsh command in Windows 2000 to script the process of changing a computer from a static Internet Protocol (IP) address to Dynamic Host Configuration Protocol (DHCP) or vice versa.The netsh command accomplishes this task without the need to restart the computer. This feature is particularly useful for laptops ,when it is necessary to use statically assigned IP addresses at one location and DHCP assigned IP addresses at another.

    To switch the specified adapter from a static address to DHCP, type the following command:
    netsh interface ip set address "Local Area Connection" dhcp
    NOTE: Typing this command changes the interface named "Local Area Connection" to DHCP.

    To display all of the adapters in the computer with their current IP addresses to determine the correct adapter name, type the following command:
    Netsh interface ip show config
    To change to a static address, type the following command:
    netsh interface ip set address "Local Area Connection" static ipaddr subnetmask gateway metric
    NOTE: Replace ipaddr with the static IP address, subnetmask with the subnet mask, gateway with the default gateway and, if necessary, metric with the appropriate metric. The following example changes the interface "Local Area Connection" to a static address of 192.168.0.10 with a subnet mask of 255.255.255.0, and the interface has a default gateway of 192.168.0.1 with a metric of 1:
    netsh interface ip set address "Local Area Connection" static 192.168.0.10 255.255.255.0 192.168.0.1 1

  4. #4
    Join Date
    May 2008
    Posts
    2,792

Similar Threads

  1. Netsh winsock reset
    By Saaz in forum Operating Systems
    Replies: 4
    Last Post: 08-12-2011, 06:31 AM
  2. Windows 7 WLAN netsh command
    By Mariah-Simpson in forum Operating Systems
    Replies: 5
    Last Post: 12-04-2010, 11:49 PM
  3. netsh winsock reset command for Mac OS X
    By CossFire in forum Operating Systems
    Replies: 4
    Last Post: 24-02-2010, 11:04 PM
  4. Change gateway IP remotely using netsh
    By RayRogers in forum Windows Server Help
    Replies: 8
    Last Post: 26-09-2008, 08:35 AM
  5. netsh to set IP address on vista..
    By pdabak@yahoo.com in forum Vista Help
    Replies: 6
    Last Post: 12-02-2008, 07:57 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,713,545,073.31924 seconds with 17 queries