netsh自动配置网络
工作需要经常在多个网络中切换,每次都要配置ip等,写个脚本一键完成配置;
netsh interface ip set address "本地连接" static “ip” ”mask“ ”nexthop“
上面这条命令可以配置网卡,但是配完之后发现我的无线网络不能用了,route print发现多了一条默认路由且优先级更高,应该跟命令的实现有关
删除默认路由:
route delete 0.0.0.0 mask 0.0.0.0 ”ip“
最后再加个ping的功能检验下配置就ok了!