1、首先,单击桌面,右击新建一个文本文档。
2、双击打开文本文档,将以下代码复制进入@echo off rem eth //eth 为网篱渥对胰卡名称,可在网络连接中查询,如”本地链接” set eth=“无线网络连接” rem ip //ip 为你想更改的IP set ip=192.168.1.103 rem gw //gw 为网关地址 set gw=192.168.1.1 rem netmasks //netmasks 为子网掩码 set netmasks=255.255.255.0 echo 正在将本机IP更改到: %ip% rem if %gw%==none netsh interface ip set address %eth% static %ip% %netmasks% %gw% 》 nul if not %gw%==none netsh interface ip set address %eth% static %ip% %netmasks% %gw% 1 》 nul echo……………………。 echo 检查当前本机IP: ipconfig echo……………………。 echo 成功将本机IP更改为%ip%! pause close
3、双斜杠后边的中文都是注释,是帮助我们读懂每一句的意思,这里可以不用去管。
4、然后文件另存为“更改IP.bat”。
5、接着双击运行就行了,如果没办法运行,就用右击管理员运行。
6、记住将代码中的IP改为自己想改成的IP地址哦。这里只是做一个例子。
7、就这么简单,希望能帮到大家。