![为什么“netsh interface delete interface”不起作用?](https://linux22.com/image/1474901/%E4%B8%BA%E4%BB%80%E4%B9%88%E2%80%9Cnetsh%20interface%20delete%20interface%E2%80%9D%E4%B8%8D%E8%B5%B7%E4%BD%9C%E7%94%A8%EF%BC%9F.png)
答案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
是环回适配器。