如何通过cmd打开WIFI?

Sir*_*ifi 21 windows wireless-networking

我的笔记本电脑的 WiFi 按钮不起作用。
Windows 中是否有任何命令可以打开 WiFi?

小智 25

使用 netsh 执行此操作:

获取接口名称:

netsh interface show interface

启用接口:

netsh interface set interface "Interface Name" enabled

要完成问题的解决方案,您可以创建一个快捷方式,并使其在 Windows 启动时运行。例如,如果您在 netsh 中的无线适配器名称是 Wi-Fi,则快捷方式将如下所示(一行):

C:\Windows\System32\runas.exe /savecred /user:administrator "C:\Windows\System32\netsh.exe interface set interface \"Wi-Fi\" enabled"

runas 命令确保该命令以管理员身份运行,这是启动或关闭接口所必需的。/savecred 开关将保存凭据,这可能会在第一次询问,但通常不会在此之后询问。


abz*_*ing 6

获取网卡列表和索引号:

wmic nic get name, index
Run Code Online (Sandbox Code Playgroud)

使用索引号启用 NIC:(例如:7)

wmic path win32_networkadapter where index=7 call enable
Run Code Online (Sandbox Code Playgroud)

使用索引号禁用 NIC:(例如:7)

wmic path win32_networkadapter where index=7 call disable
Run Code Online (Sandbox Code Playgroud)

  • 以上强烈建议逐字来自此链接 - 请下次引用您的来源:https://answers.microsoft.com/en-us/windows/forum/windows_7-hardware/enabledisable-network-interface-via-command -line/17a21634-c5dd-4038-bc0a-d739209f5081 (2认同)