看QQ高手教你如何用命令行更改IP地址
在Windows中,如果你要设置IP地址,一般是进入“本地连接”->“属性”,手动设置要更改的IP地址。其实,在命令行同样可以设置IP地址。如果你的IP需要在几个IP中来回切换,可以使用 netsh 命令更改:<BR><BR> 1.进入CMD命令行;<BR><BR> 点击“开始”->“运行”,输入“cmd”,回车,<BR><BR> 2.设置IP:<BR><BR> 设置动态获取IP地址(DHCP)<BR><BR><A href="http://news.skycn.com/newsimg/2008/0703-42.jpg" target=_blank><IMG onclick="if(this.width>=700) window.open('http://news.skycn.com/newsimg/2008/0703-42.jpg');" src="http://news.skycn.com/newsimg/2008/0703-42.jpg" onload="if(this.width>'700')this.width='700';if(this.height>'700')this.height='700';" border=0></A><BR><BR> 设置固定IP<BR><BR><A href="http://news.skycn.com/newsimg/2008/0703-43.jpg" target=_blank><IMG onclick="if(this.width>=700) window.open('http://news.skycn.com/newsimg/2008/0703-43.jpg');" src="http://news.skycn.com/newsimg/2008/0703-43.jpg" onload="if(this.width>'700')this.width='700';if(this.height>'700')this.height='700';" border=0></A><BR><BR> 参数说明:<BR><BR> 1.name:网络连接名称,一般为“本地连接”。你可以在“控制面板”->“网络连接”中看到。<BR><BR> 2.source:获取IP的途径。动态获取,则为dhcp,手动设置,则为static。 <BR><BR> 3.addr:要设置的IP地址。 <BR><BR> 4.mask:子网掩码。 <BR><BR> 5.gateway:网关地址。<BR><BR> 6.gwmetric:网关跃点数,可以设置为整型数值,也可以设置为“自动”:auto。 <BR><BR> 3.设置DNS:<BR><BR> 自动获取DNS<BR><BR><A href="http://news.skycn.com/newsimg/2008/0703-44.jpg" target=_blank><IMG onclick="if(this.width>=700) window.open('http://news.skycn.com/newsimg/2008/0703-44.jpg');" src="http://news.skycn.com/newsimg/2008/0703-44.jpg" onload="if(this.width>'700')this.width='700';if(this.height>'700')this.height='700';" border=0></A><BR><BR> 手动设置单个DNS<BR><BR><A href="http://news.skycn.com/newsimg/2008/0703-45.jpg" target=_blank><IMG onclick="if(this.width>=700) window.open('http://news.skycn.com/newsimg/2008/0703-45.jpg');" src="http://news.skycn.com/newsimg/2008/0703-45.jpg" onload="if(this.width>'700')this.width='700';if(this.height>'700')this.height='700';" border=0></A><BR><BR> 手动设置多个DNS<BR><BR><A href="http://news.skycn.com/newsimg/2008/0703-46.jpg" target=_blank><IMG onclick="if(this.width>=700) window.open('http://news.skycn.com/newsimg/2008/0703-46.jpg');" src="http://news.skycn.com/newsimg/2008/0703-46.jpg" onload="if(this.width>'700')this.width='700';if(this.height>'700')this.height='700';" border=0></A><BR><BR> 参数说明:<BR><BR> 1.name:网络连接名称,一般为“本地连接”。你可以在“控制面板”->“网络连接”中看到。<BR><BR> 2.source:获取IP的途径。动态获取,则为dhcp,手动设置,则为static。 <BR><BR> 3.addr:要设置的IP地址。 <BR><BR> 4.register:<BR><BR> 5.none: 禁用动态 DNS 注册。<BR><BR> 6.primary: 只在主 DNS 后缀下注册。<BR><BR> 7.both: 在主 DNS 后缀下注册,也在特定连接后缀下注册。 <BR><BR> 8.index:设置的DNS的顺序号。<BR><BR> 4.编写设置IP/DNS的批处理文件:<BR><BR> 知道了如何设置IP和DNS后,你可以自己编写一个BAT文件:<BR><BR> 新建一个文本文档,将后缀改为“.bat”;<BR><BR> 编辑“.bat”文件的内容为上面的设置命令。例如:<BR><BR><A href="http://news.skycn.com/newsimg/2008/0703-47.jpg" target=_blank><IMG onclick="if(this.width>=700) window.open('http://news.skycn.com/newsimg/2008/0703-47.jpg');" src="http://news.skycn.com/newsimg/2008/0703-47.jpg" onload="if(this.width>'700')this.width='700';if(this.height>'700')this.height='700';" border=0></A><BR><BR> 运行时,双击这个bat文件,等待设置完成即可。 <BR><BR> 关于netsh命令的详细使用说明,可以在命令行,输入 netsh /? 命令查看,这里就不做说明了,希望能对你有用。 *** 作者被禁止或删除 内容自动屏蔽 *** 感谢分享页:
[1]