<分区>
我正在尝试使用 netsh 编写一些简短的脚本。一种是将适配器更改为静态寻址,另一种是将同一适配器更改回 DHCP。
我可以使用所有正确的静态地址设置来设置适配器
netsh interface ip set address "Local Area Connection" static 10.61.1.253 255.255.255.0 10.61.1.1 1
这很好用。当我运行以下命令(脚本)切换回 DHCP 时,我收到一条错误消息。
netsh interface ip set address "Local Area Connection" dhcp
DHCP is already enabled on this interface.
这是在 Windows 7 机器上。
知道问题出在哪里吗?