Name

netsh

Synopsis

Configures networking services from the command line.

Syntax

netsh [-a Aliasfile] [-c Context] [-r RemoteComputer] [command | 
-f Scriptfile]

Options

-r RemoteComputer

Specifies the remote computer on which Netshell commands are to be executed. The computer can be specified using its computer name (NetBIOS or DNS name) or IP address. If this option is omitted, the commands are executed on the local computer.

-a Aliasfile

Specifies an alias file to use, which is a file containing a list of Netshell commands together with an alias to allow the commands to be used by just typing the alias name (useful for mapping commands on other platforms, such as Unix, to specific Netshell commands).

-c Context

Opens the Netshell shell and switches immediately to the specified context.

command

Specifies any Netshell global command to be executed immediately (see Section later in this article).

-f Scriptfile

Runs the Netshell commands found in the file Scriptfile (include path).

Examples

Open the Netshell shell:

C:\>netsh
netsh>

Open the Netshell shell in the DHCP context to configure DHCP interactively:

C:\>netsh -c dhcp
dhcp>

Open the Netshell shell, switch to the IP subcontext of the Interface context, obtain IP address information about the network interface, and return to the command shell:

C:\>netsh -r 172.16.11.104 -c interface ip show address Configuration for interface "Local Area Connection" DHCP enabled: No IP Address: 172.16.11.104 SubnetMask: 255.255.255.0 Default Gateway: 172.16.11.196 ...

Get Windows 2000 Administration in a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.