怎样从Windows 7命令行中连接无线WIFI网络

[原文发表地址] How to connect to a Wireless WIFI Network from the Command line in Windows 7

[原文发表时间] 2011-07-27 8:28 PM

对于那些一本正经的人,看完2011更新版的针对Mac OS X Lion和Windows 7的麦当劳WiFi指南,就会有趣的问:“好吧,先生,你们是怎么通过Windows 7 的命令行来连接无线WIFI网络的?”

这个问题的答案就是,这样的:

  1: C:\>netsh wlan connect name=HANSELMAN-N 
  2: Connection request was completed successfully.

真酷。

更多细节

到底是怎样的呢?好吧命令行其实就是netsh wlan,全称是:

netsh wlan connect ssid=YOURSSID name=PROFILENAME

配置又是什么呢?这是唯一需要的东西。你可以通过以下途径看到:

C:\>netsh wlan show profile

无线网络连接界面上的:

…片段…

User profiles
-------------
All User Profile : Clear Spot b0e
All User Profile : HANSELMAN-N
All User Profile : Quiznos

这和你在无线网络对话框中看到的东西一样。

你可以自行设置,然后根据命令行或分批处理文件来找到它们。对于你常用的地址,这就非常方便了。 如果你有多个无线网卡(你想干嘛?!) 那么就需要指定更多的信息

netsh wlan connect ssid=YOURSSID name=PROFILENAME interface="WIRELESS NETWORK CONNECTION"

当然你也可以

netsh wlan disconnect

针对多接口也可以选择将接口包含进来。另外当你输入以下内容时,你会发现有趣的现象:

netsh wlan dump

这很不错。因为你能在一台机器上执行:

netsh wlan dump > myconfig.txt

然后在另外一台机器上执行:

netsh exec myconfig.txt

所有这些命令行基本都能在Windows各个版本中运行,除了7 AFAIK。在网站上你还能找到更多有关无线资料管理的文件和信息

希望你们喜欢!