使用命令批量添加ip地址

添加ip地址

FOR /L %A IN (10,1,20) DO netsh interface ipv4 add address “249” 192.168.1.%A 255.255.255.0    //FOR / L%variable IN(开始,步骤,结束)DO命令

删除ip地址

FOR /L %A IN (10,1,20) DO netsh interface ipv4 delete address “249” 192.168.1.%A 255.255.255.0

添加单个ip地址:

netsh interface ipv4 add address “Local Area Connection” 192.168.1.2 255.255.255.0

参考地址:

https://blog.csdn.net/cum88284/article/details/109034558

posted @ 2021-04-06 11:44  烘烘火火  阅读(521)  评论(0编辑  收藏  举报