这个问题似乎是与连接名称。 如果运行
netsh interface ip set address "Wireless Network Connection" static 192.168.1.26 255.255.255.0 192.168.1.1
"Wireless Network Connection"
应该存在完全一样的给定名称为一个接口。它就像您正在引用的别名。
如果你看看你的接口netsh interface ip show config
确实存在"Wireless Network Connection"
吗?可能是"Wireless Network Connection 2"
之类的其他东西,然后你会得到确切的错误,因为你已经发布。
编辑
根据您的评论。
记住要为每一行添加正确的接口名称,但您的最新问题是真的,在最后一行添加DNS服务器
netsh interface ip set address "Connection name goes here" static 192.168.1.26 255.255.255.0 192.168.1.1
netsh interface ip set dns "Connection name goes here" static 8.8.8.8
netsh interface ip add dnsserver "Connection name goes here" address=4.2.2.2 index=1
注意您还可以使用
netsh interface ipv4 add dnsserver "Connection name goes here" address=4.2.2.2 index=1
就index=1
而言,请记住根据要首先索引的DNS服务器进行设置。
'netsh接口IP添加/'不显示'加dns'但'加dnsservers' – JosefZ
我得到什么?与没有wlan适配器的系统上的第一个命令非常相同的错误信息。 – LotPings