为什么“netsh interface delete interface”不起作用?

为什么“netsh interface delete interface”不起作用?

设想:Windows XP 专业版 SP3 (Hyper-V VM)

我正在尝试从我的计算机中删除特定的网络接口。

首先,我使用以下netsh interface show interface命令显示所有接口:

在此处输入图片描述

然后,我决定删除任何“本地连接”接口,从 1 到 7,但在所有尝试中我都收到相同的消息:“参数不正确”

语法与示例完全相同。

在此处输入图片描述

我究竟做错了什么?

答案1

正如我们从 Conker 那里学到的,生活中有些事情上下文相关。 中的每个命令级别netsh都有可用的特定选项。如果您运行,netsh ?您将看到delete在“此上下文中的命令”下列出的内容:

C:\WINDOWS\system32>netsh ?

Usage: netsh [-a AliasFile] [-c Context] [-r RemoteMachine] [-u [DomainName\]UserName] [-p Password | *]
             [Command | -f ScriptFile]

The following commands are available:

Commands in this context:
?              - Displays a list of commands.
add            - Adds a configuration entry to a list of entries.
advfirewall    - Changes to the `netsh advfirewall' context.
branchcache    - Changes to the `netsh branchcache' context.
bridge         - Changes to the `netsh bridge' context.
delete         - Deletes a configuration entry from a list of entries.
dhcpclient     - Changes to the `netsh dhcpclient' context.
dnsclient      - Changes to the `netsh dnsclient' context.
dump           - Displays a configuration script.
exec           - Runs a script file.
firewall       - Changes to the `netsh firewall' context.
help           - Displays a list of commands.
http           - Changes to the `netsh http' context.
interface      - Changes to the `netsh interface' context.
ipsec          - Changes to the `netsh ipsec' context.
lan            - Changes to the `netsh lan' context.
mbn            - Changes to the `netsh mbn' context.
namespace      - Changes to the `netsh namespace' context.
netio          - Changes to the `netsh netio' context.
p2p            - Changes to the `netsh p2p' context.
ras            - Changes to the `netsh ras' context.
rpc            - Changes to the `netsh rpc' context.
set            - Updates configuration settings.
show           - Displays information.
trace          - Changes to the `netsh trace' context.
wcn            - Changes to the `netsh wcn' context.
wfp            - Changes to the `netsh wfp' context.
winhttp        - Changes to the `netsh winhttp' context.
winsock        - Changes to the `netsh winsock' context.
wlan           - Changes to the `netsh wlan' context.

The following sub-contexts are available:
 advfirewall branchcache bridge dhcpclient dnsclient firewall http interface ipsec lan mbn namespace netio p2p ras rpc trace wcn wfp winhttp winsock wlan

To view help for a command, type the command, followed by a space, and then
 type ?.

如果你跑,netsh interface ?你会看到delete 不是在“以下命令可用”下列出:

C:\WINDOWS\system32>netsh interface ?

The following commands are available:

Commands in this context:
6to4           - Changes to the `netsh interface 6to4' context.
?              - Displays a list of commands.
dump           - Displays a configuration script.
help           - Displays a list of commands.
httpstunnel    - Changes to the `netsh interface httpstunnel' context.
ipv4           - Changes to the `netsh interface ipv4' context.
ipv6           - Changes to the `netsh interface ipv6' context.
isatap         - Changes to the `netsh interface isatap' context.
portproxy      - Changes to the `netsh interface portproxy' context.
set            - Sets configuration information.
show           - Displays information.
tcp            - Changes to the `netsh interface tcp' context.
teredo         - Changes to the `netsh interface teredo' context.
udp            - Changes to the `netsh interface udp' context.

The following sub-contexts are available:
 6to4 httpstunnel ipv4 ipv6 isatap portproxy tcp teredo udp

To view help for a command, type the command, followed by a space, and then
 type ?.

您无法在上下文中删除接口interface,但可以在lan(局域网)、wlan(无线局域网)和mbn(移动宽带网络)上下文中删除。同样,您可以在上下文中卸载网桥bridge。我认为您无法通过某些上下文删除/卸载的唯一类型的网络接口netsh是环回适配器。

相关内容