Netsh Commands for Wired Local Area Network (lan)
The Windows Vista™ Netsh commands for wired local area network (LAN) provide methods to configure connectivity and security settings. You can use the Netsh lan commands to configure the local computer, or to configure multiple computers by using a logon script. You can also use the netsh lan commands to view wired 802.1X Group Policy and to administer user wired 802.1X settings.
The wired Netsh command line provides easier secure wired deployment: Provides an alternative to Windows Server® Code Name "Longhorn" Group Policy to configure wired connectivity and security settings.
Netsh LAN Commands for Wired Interface
You can run these commands from the Windows Vista command prompt by switching to the lan context using the following instructions.
Entering the netsh lan context
To enter the netsh context for lan
1. | Click Start, click Run, type cmd, and then click OK, to open a command prompt. |
2. | At the command prompt, type netsh and press Enter, then type lan and press Enter. |
Formatting legend
Format | Meaning |
Italic | Information that the user must supply. |
Bold | Elements that the user must type exactly as shown. |
Ellipsis (…) | Parameter that can be repeated several times in a command line. |
Between brackets([]) | Optional items |
Between braces ({}); choices separated by pipe (|). Example: {even|odd} | Set of choices from which the user must choose only one. |
Commands in the netsh lan context
The following command is available in this context:
- Netsh command "?" - Displays a list of commands or parameters.
- add - Adds a profile to the specified interface on the computer.
- delete - Removes a LAN profile from the specified interface on the computer.
- dump - Generates and saves a script that contains the current configuration.
- export - Saves LAN profiles as XML files to a specified location.
- help - Displays a list of commands.
- reconnect - Reconnects to the network using the specified adapter.
- set - Sets wired configuration.
- show - Displays information.
Netsh command "?"
Displays a list of commands or parameters
Syntax: |
CommandName/? |
Parameters: |
There are no parameters associated with this command. |
Remarks: |
Displays a list of commands or parameters. |
Example command: |
|
Description: |
The example command, ?, displays the entire list of contexts supported by netsh. The example command, add /?, displays a list of commands within the add command. The example command, delete profile /?, displays a list of parameters for the delete profile command. |
add
Adds a LAN profile to the specified interface on the computer.
add profile
Add a LAN profile to the specified interface on the computer
Syntax: | add profile filename=PathAndProfileNameinterface= InterfaceName |
||||
Parameters: |
|
||||
Remarks: |
The interface parameter specifies one of the interface names shown by the netsh lan show interface command. The profile will be added to the specified interface. There is wildcard support for this parameter. You can use the characters ? and * to replace a letter and letters of the interface name, respectively. |
||||
Example command: |
|
delete
Deletes a profile from the wired 802.1X profile store.
delete profile
Removes a LAN profile from one or multiple interfaces.
Syntax: | delete profile interface=InterfaceName |
||
Parameters: |
|
||
Remarks: |
There is wildcard support for the interface parameter. You can use the characters ? and * to replace a letter and letters of the interface name, respectively. |
||
Example command: |
|
dump
Generates and saves a script that contains the current configuration to the specified location
Syntax: |
dump >PathAndFileName |
Parameters: |
There are no parameters associated with this command. |
Remarks: |
Creates a script that contains the current configuration, which can be used to restore altered configuration settings. |
Example command: |
|
export
Saves LAN profiles as XML files to the specified location
export profile
Syntax: |
export profile folder=PathAndFileName [[interface=]InterfaceName] |
||||
Parameters |
|
||||
Remarks: |
The folder parameter must specify an existing folder that is accessible from the local computer. It can be either an absolute path or relative path to the current working directory. In addition, "." refers to the current working directory, and ".." refers to the parent directory of the current working directory. The folder name cannot be a Universal Naming Convention (UNC) path. If the interface parameter is specified, only the specified profile associated with that interface is saved. Otherwise all profiles on the computer with the specified name are saved. Profiles of specified interfaces are saved in the format "InterfaceName ProfileName.xml." Profiles at the computer level are saved in the file name format "ProfileName.xml." There is wildcard support for this parameter. You can use the characters ? and * to replace a letter and letters of the interface name, respectively. |
||||
Example command: |
|
help
Displays a list of commands or parameters
Syntax: |
CommandNamehelp |
Parameters: |
There are no parameters associated with this command. |
Remarks: |
Displays a list of commands or parameters for the specified command |
Example command: |
|
reconnect
Attempts to reauthenticate to a wired network by using the specified interface
Syntax: |
reconnect[[interface=]InterfaceName] |
||
Parameters: |
|
||
Remarks: |
If the interface parameter is specified, only that interface attempts to reconnect. If the interface parameter is not specified, all interfaces attempt to reconnect. Wildcard (*) names cannot be used to specify the interface name. |
||
Example commands: |
|
set
Sets the configuration on interfaces. The following commands are available in this context:
- set autoconfig - Enable or disable Wired AutoConfig Service on an interface.
- set tracing - Enable or disable tracing.
set autoconfig
Enables or disables Wired AutoConfig Service on an interface
Syntax: |
set autoconfig enabled={yes|no}interface= InterfaceName |
||||
Parameters: |
|
||||
Remarks: |
When autoconfig is enabled, Windows Windows Vista automatically connects to the network by using the specified interface. By default, autoconfig is enabled. If autoconfig is disabled, Windows will not automatically connect to any networks by using the specified interface. There is wildcard support for the interface parameter. You can use the characters ? and * to replace a letter and letters of the interface name, respectively. |
||||
Example command: |
|
set tracing
Enables or disables tracing
Syntax: |
set tracing [[mode=]{yes|no| persistent}] |
||
Parameters: |
|
||
Remarks: |
The default value for the mode parameter is nonpersistent. |
||
Example command: |
|
![]() |
Note |
For Windows Vista Beta 2, and Windows Vista Beta 1, the “set tracing” command syntax is:
set tracing enabled={yes|no} [[mode=]{persistent|nonpersistent}]
The enabled parameter is required. The mode parameter is optional. If the mode parameter is set to persistent, trace logs are always generated until the enabled parameter is set to no.
The default value for the mode parameter is nonpersistent.
show
Displays information. The following commands are available in this context:
- show interfaces - Displays a list of the current wired interfaces on the computer.
- show profiles - Displays a list of wired profiles that are configured on the computer.
- show settings - Displays the current global settings of the wired LAN.
- show tracing - Displays whether wired tracing is enabled or disabled.
show interfaces
Displays a list of the current wired interfaces on the computer
Syntax: |
show interfaces |
Parameters: |
There are no parameters for this command. |
Remarks: |
Shows the wired interfaces configured on the computer. Displayed information includes:
|
Example command: |
|
show profiles
Displays a list of wired profiles that are configured on the computer
Syntax: |
show profiles[[interface=]InterfaceName] |
||
Parameters: |
|
||
Remarks: |
If the interface parameter is specified, then only the contents of the profile for the specified interface is displayed. Otherwise all profiles will be displayed with their name and description. |
||
Example commands: |
|
show settings
Displays the current global settings of the wired LAN
Syntax: |
show settings |
Parameters: |
There are no parameters for this command. |
Remarks: |
Shows whether or not auto-configuration is enabled on each interface. |
Example command: |
|
show tracing
Displays whether wired tracing is enabled or disabled
Syntax: |
show tracing |
Parameters: |
There are no parameters for this command. |
Remarks: |
Displayed information includes:
|
Example command: |
|
![]() |
Top of page |