V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
jmyz0455
V2EX  ›  Windows

如何通过 PowerShell 使 Windows10 切换 WiFi 网络?

  •  
  •   jmyz0455 · 2017-04-05 16:44:16 +08:00 · 3208 次点击
    这是一个创建于 2570 天前的主题,其中的信息可能已经有所发展或是发生改变。

    比如现在有 SSID 为 AAA 和 BBB 两个网络(都是已连接过的),我现在连接的是 AAA ,请问如何通过 PowerShell 使 Windows10 切换 WiFi 网络为 BBB 呢?

    上网搜了一圈,发现其他人用 netsh wlan show profiles 找到配置名,然后再用 netsh wlan connect name="BBB" 就可以了,但是我总是显示 配置文件“ BBB ”指定的网络无法用于连接。加上 ssid="BBB" 还是这样,如何解决这个问题?

    用 netsh wlan show interfaces 可以看到我现在的接口状态里 SSID 和 profile 都是 AAA 。

    纯属玩玩,不喜勿喷。

    1 条回复    2017-04-09 11:46:44 +08:00
    KexyBiscuit
        1
    KexyBiscuit  
       2017-04-09 11:46:44 +08:00
    简单翻了一下, Windows PowerShell 5.1 为止没有提供 Wi-Fi 相关的 cmdlet ,那么比较合适的方式就是内联 .NET 代码了。
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   980 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 28ms · UTC 20:26 · PVG 04:26 · LAX 13:26 · JFK 16:26
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.