networking - 从命令行启用/禁用网络连接

标签 networking cmd windows-xp

我知道 Google 上有大量这样的结果:results ,但我没有在我的 Windows XP 机器上成功。我想从命令行禁用 LAN 连接。

>netsh interface set interface "Local Area Connection" DISABLED
One or more essential parameters not specified
The syntax supplied for this command is not valid. Check help for the correct sy
ntax.

>netsh interface set interface name="Local Area Connection" admin="disabled"
One or more essential parameters not specified
The syntax supplied for this command is not valid. Check help for the correct sy
ntax.

>netsh interface set interface name="Local Area Connection" admin=DISABLED
One or more essential parameters not specified
The syntax supplied for this command is not valid. Check help for the correct sy
ntax.

最佳答案

对于前两个命令,您需要提升/管理员权限:

禁用 LAN 网络连接

C:\> netsh interface set interface name="Local Area Connection" admin=disabled

启用 LAN 网络连接

C:\> netsh interface set interface name="Local Area Connection" admin=enabled

假设:您的接口(interface)被命名为“本地连接”,否则请替换为正确的名称。使用netsh interface show interface查找名称。

列出 Wifi 配置文件

C:\> netsh wlan show profiles

连接到 Wifi 配置文件

C:\> netsh wlan connect name="ProfileName"

关于networking - 从命令行启用/禁用网络连接,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19831023/

相关文章:

客户端 : recv transport endpoint not connected

linux - 使用静态路由手动设置网关

C绑定(bind)到指定的TCP端口

c# - 如何让 .NET Windows 服务检测登录、注销和切换用户事件?

c# - 使用脚本编辑 windows xp 注册表

c - 如何使用 C 在没有互联网连接、没有 eth0 且没有任何硬编码常量的情况下获取我的外部 ip(主接口(interface))

cmd - Windows 7 netcat 错误 : 'nc' is not recognized as an internal or external command

node.js - 在CMD中设置多个PATH变量

windows - 从带有 %~dp0% 的路径复制文件不起作用

c# - 使用 C# 在本地注销 Windows 用户