The Windows Vista™ Netsh commands for wireless local area network (WLAN) provide methods to configure connectivity and security settings. You can use the Netsh wlan commands to configure the local computer, or to configure multiple computers by using a logon script. You can also use the netsh wlan commands to view wireless Group Policy settings and to administer WISP and user wireless settings.
The wireless Netsh interface has the following benefits:
- Easier wireless deployment: Provides a light-weight alternative to Group Policy to configure wireless connectivity and security settings.
- Mixed mode support: Allows administrators to configure clients to support multiple security options. For example, a client can be configured to support both the WPA2 and the WPA authentication standard. This allows the client to use WPA2 to connect to networks that support WPA2 and use WPA to connect to networks that only support WPA.
- Block undesirable networks: Administrators can block and hide access to non-corporate wireless networks by adding specific networks or network types to the list of denied networks. Similarly, administrators can allow access to corporate wireless networks.
Netsh WLAN commands for wireless interface
You can run these commands directly from the Windows Vista command prompt by typing netsh wlan followed by the command, or by switching to the wlan context by using the following instructions.
Entering the netsh wlan context
To enter the netsh context for wlan
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 wlan 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 wlan context
The following commands are available in this context:
- Netsh command "?" - Displays a list of commands or parameters.
- add - Adds a filter or profile to the specified wireless interface on the computer.
- connect - Connects to a wireless network.
- delete - Removes a filter or profile from the specified wireless interface on the computer.
- disconnect - Disconnects from a wireless network.
- dump - Generates and saves a script that contains the current configuration, to the specified location.
- export - Save WLAN profiles as XML files in the specified location.
- help - Displays the list of commands.
- set - Sets wireless configuration information.
- show - Displays configuration information for the specified wireless interface.
Netsh command "?"
Displays a list of commands or parameters.
Syntax: | CommandName/? |
Parameters: | There are no parameters for this command. |
Remarks: | Displays a list of commands or parameters. |
Example commands: |
|
Description: | The example command, ?, displays the entire list of commands or parameters 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 filter or profile to the specified interface on the computer. The following commands are available in this context:
- add filter - Add a wireless network into the wireless allowed or blocked list.
- add profile - Add a wlan profile to the specified interface on the computer.
add filter
Adds a wireless network to the wireless allowed or blocked list
Syntax: | add filter permission={allow|block| denyall} ssid=WirelessNetworkNamenetworktype={infrastructure| adhoc} | ||||||
Parameters: |
| ||||||
Remarks: | The ssid parameter is required if permission is allow or block. If permission is denyall, do not specify the ssid parameter. | ||||||
Example commands: |
|
add profile
Adds a wlan profile to the specified interface on the computer
Syntax: | add profile filename=PathAndFileName [[interface=]InterfaceName] [[user=]{all|current}] | ||||||
Parameters: |
| ||||||
Remarks: | The interface parameter is one of the interface names shown by the netsh wlan 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. The user parameter, if unspecified, applies the profile to the current user. | ||||||
Example command: |
|
connect
Connects to a wireless network by using the specified parameter
Syntax: | connect[[ssid=]SSIDName] name=ProfileNameinterface= InterfaceName | ||||||
Parameters: |
| ||||||
Remarks: | The interface parameter is required only if there is more than one wireless interface on the computer. Wildcard (*) names cannot be used to specify the interface name. If the specified interface is already connected to a wireless network, this command disconnects the interface from that network, and then attempts to connect to the new network. If the command attempts to connect to a network to which the interface is already connected, this command returns a message that the connection was successful, and does not change the state of the wireless adapter. | ||||||
Example commands: |
|
delete
Deletes a WLAN profile from the specified interface on the computer. The following commands are available in this context:
- delete filter - Removes a wireless network from the wireless allowed or blocked list.
- delete profile - Removes a WLAN profile from one or multiple interfaces.
delete filter
Removes a wireless network from the wireless allowed or blocked list
Syntax: | delete filter permission={allow|block| denyall} ssid=WirelessNetworkNamenetworktype={ infrastructure|adhoc}] | ||||||
Parameters: |
| ||||||
Remarks: | The ssid parameter is required, unless the value of the permission parameter is denyall. Then the ssid parameter should not be given. | ||||||
Example commands: |
|
delete profile
Removes a WLAN profile from one or multiple interfaces
Syntax: | delete profile name=ProfileName [[interface=]InterfaceName] | ||||
Parameters: |
| ||||
Remarks: | If the interface parameter is specified, then the profile will be deleted only from the specified interface. If the interface parameter is not specified, then the profile will be deleted from all interfaces on the computer. 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: |
|
disconnect
Disconnects the specified interface from a wireless network
Syntax: | disconnect interface=InterfaceName | ||
Parameters: |
| ||
Remarks: | The interface parameter is required if there is more than one wireless interface on the computer. Wildcard (*) names cannot be used to specify the interface name. If the specified interface is not already connected to a wireless network, this command returns a message stating that the disconnection was successful. The state of the wireless adapter does not change. | ||
Example commands: |
|
dump
Generates and saves a script that contains the current configuration to the specified location
Syntax: | dump >PathAndFileName |
Parameters: | There are no parameters for this command. |
Remarks: | Creates a script that contains the current configuration, which can be used to restore altered configuration settings. |
Example command: |
|
| |
export
Saves WLAN profiles as XML files to the specified location
export profile
Syntax: | export profile folder=PathAndFileName [[name=]ProfileName] [[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 name parameter is specified, then only that profile is saved. Otherwise, if the interface parameter is specified, all wireless profiles on the specified interface are saved. If the interface parameter is not specified, all wireless profiles on the computer are saved. If the interface parameter is specified, only the specified profile for that interface is saved. Otherwise all profiles on the computer with the specified name are saved. Profiles of specified interfaces are saved in the file name 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 for this command. |
Remarks: | Displays a list of commands or parameters |
Example command: |
|
set
Sets the configuration on interfaces. The following commands are available in this context:
- set autoconfig - Enable or disable Wireless-Auto-Config-Service on the interface.
- set blockednetworks - Show or hide the blocked networks in the visible network list.
- set profileorder - Set the connection preference order of wireless network profiles.
- set tracing - Enable or disable tracing.
set autoconfig
Enables or disables WLAN Auto Config Service on an interface
Syntax: | set autoconfig enabled={yes|no} interface=InterfaceName | ||||
Parameters: |
| ||||
Remarks: | When WLAN Auto Config Service is enabled, Windows Windows Vista automatically connects to wireless networks by using the specified interface. By default, autoconfig is enabled. If autoconfig is disabled, Windows will not automatically connect to any wireless 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 blockednetworks
Shows or hides the blocked networks in the visible network list
Syntax: | set blockednetworks display={show|hide} | ||
Parameters: |
| ||
Example command: | set blockednetworks display=show | ||
Description: | The example command specifies that blocked networks are shown in the list of available networks. |
set profileorder
Sets the preference order of a wireless network profile
Syntax: | set profileorder name=ProfileNameinterface=InterfaceName priority=integer | ||||||
Parameters: |
| ||||||
Remarks: | If parameter priority is set to 0 or 1, the profile will move to the first position in the list, regardless of whether another profile was previously set to 0 or 1. A lower number means a higher priority. There is no limit on the number of profiles you can have on a computer. | ||||||
Example command: |
|
set tracing
Enables or disables tracing
Syntax: | set tracing [[mode=]{yes|no| persistent}] | ||
Parameters: |
| ||
Remarks: | If the mode parameter is set to yes, nonpersistent tracing is active until the mode is either set to no or the computer is restarted. If the mode parameter is set to no, tracing is stopped for either persistent or nonpersistent tracing. If the mode parameter is set to persistent, tracing will still be active even after the computer is restarted. The default value for 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 all - Displays the entire collection of wireless device and wireless networks information.
- Show autoconfig - Displays whether the Wireless-AutoConfig-Service is enabled or disabled.
- Show blockednetworks - Displays whether blocked network settings are set to display or hide.
- show drivers - Displays the properties of the wireless adapter drivers on the computer.
- show filters - Displays the current list of allowed and blocked wireless networks.
- show interfaces - Displays a list of the current wireless interfaces on the computer
- show networks - Displays a list of wireless networks that are visible on the computer.
- show profiles - Displays a list of wireless profiles that are configured on the computer.
- show settings - Displays the current global settings of the wireless LAN.
- show tracing - Displays whether wireless tracing is enabled or disabled.
show all
Displays the entire collection of wireless device and wireless networks information
Syntax: | show all |
Parameters: | There are no parameters for this command. |
Remarks: | Displays the entire collection of 802.11 wireless interface information, network information, and wireless settings on the system, including:
|
Example command: |
|
show autoconfig
Displays whether Wireless-Auto-Config-Service is enabled or disabled
Syntax: | show autoconfig |
Parameters: | There are no parameters for this command. |
Remarks: | Displays whether Wireless-Auto-Config-Service is enabled or disabled on each wireless adapter interface. |
Example command: |
|
show blockednetworks
Displays the global setting whether to display or hide blocked networks in the visible network list
Syntax: | show blockednetworks |
Parameters: | There are no parameters for this command. |
Remarks: | Displays the global setting whether to display or hide blocked networks in the visible network list. |
Example command: | show blockednetworks |
show drivers
Displays the properties of the wireless adapter drivers on the computer
Syntax: | show drivers[[interface=]InterfaceName] | ||
Parameters: |
| ||
Remarks: | Shows the 802.11 wireless LAN interface driver information. The following list summarizes the type of information presented by this command:
| ||
Example command: |
|
show filters
Displays the current list of allowed and blocked wireless networks
Syntax: | show filters[[permission=]{allow| block}] | ||
Parameters: |
| ||
Remarks: | If parameter permission is specified, the command displays the list of networks configured on the system that have the specified permission type (allow or block). Otherwise, both the allowed and blocked lists are shown. | ||
Example command: |
|
show interfaces
Displays a list of the current wireless interfaces on a computer
Syntax: | show interfaces |
Parameters: | There are no parameters for this command. |
Remarks: | Shows the wireless interfaces configured on the computer. Displayed information includes:
|
Example command: |
|
show networks
Displays a list of wireless networks that are visible on the computer
Syntax: | show networks[[interface=]InterfaceName] [[mode=] {ssid|bssid}] | ||||
Parameters: |
| ||||
Remarks: | Displays the wireless networks available to the computer. If the interface parameter is specified, only the networks visible to the specified interface are listed. Otherwise, all networks visible to the computer are listed. If the mode=bssid parameter is specified, then information for the visible BSSIDs for each visible SSID is listed. Displayed BSSID information includes:
If the mode=ssid parameter is specified, then information about each visible SSID is listed. Displayed SSID information includes:
Displayed SSID information includes:
| ||||
Example command: |
|
show profiles
Displays a list of wireless profiles that are configured on the computer
Syntax: | show profiles[[name=]ProfileName] [[interface=]InterfaceName] | ||||||
Parameters: |
| ||||||
Remarks: | Displays the profile data or lists the profiles on the computer. If the name parameter is specified, then only the content for the specified profile is displayed. If the name parameter is not specified, only the profile name and description are displayed. If the interface parameter is specified, only the profiles on the specified interface are displayed. If the interface parameter is not specified, all profiles with the specified name are displayed. Displayed information includes:
| ||||||
Example commands: |
|
show settings
Displays the current global settings of the wireless LAN
Syntax: | show settings |
Parameters: | There are no parameters for this command. |
Remarks: | Shows the global setting for wireless network service, including whether or not WLAN Auto Config Service is enabled on each interface and whether blocked networks are shown or hidden. Allow and block filter lists are available by using the show filters command. |
Example command: |
|
show tracing
Displays whether wireless tracing is enabled or disabled
Syntax: | show tracing | ||
Parameters: | There are no parameters for this command. | ||
Remarks: | Displayed information includes:
| ||
Example command: |
| ||
| |||
No comments:
Post a Comment