使用netsh命令可对网络进行进行启用或禁用
查看可启用或禁用的网络接口
netsh interface show interface 或 netsh int show int
进行启用或禁用
netsh interface set interface name="本地连接" admin=enabled connect=connected
netsh interface set interface name="本地连接" admin=disabled
可name不在 show interface中则会提示
此名称的接口未与路由器一起注册
如果是 vpn 请使用 rasdial 进行连接 可参考 vpn 的异常处理:http://hi.baidu.com/glamour/item/d0eb63faa6ba426a3c1485d8
更多可参考 netsh /?