@echo off @echo 开始设置IP netsh interface ip set address name=”本地连接" source=static addr=59.36.100.195 mask=255.255.255.0 gateway=59.36.100.1 gwmetric=auto netsh interface ip set dns name=”本地连接" source=static addr=202.96.128.86 register=primary @echo on @echo IP已设置 @echo off pause DEL "C:/Documents and Settings/Administrator/「开始」菜单/程序/启动/IP.bat" END |
把上面的复制,修改IP、掩码、网关、DNS,将文件保存为ip.bat。并将本文件放到:C:/Documents and Settings/Administrator/「开始」菜单/程序/启动 目录下。
DEL "C:/Documents and Settings/Administrator/「开始」菜单/程序/启动/IP.bat"
这个路径请根据自己超级管理员的实际情况处理
比如说你的超级管理员修改为了admin
那么你的实际路径就是:
C:/Documents and Settings/admin/「开始」菜单/程序/启动/IP.bat
如果是双IP,和双DNS呢?那么可以简化的写为:
@echo off netsh interface ip set address "本地连接" source=static 192.168.0.118 255.255.255.0 gateway=192.168.0.1 gwmetric=auto @echo on pause DEL "C:/Documents and Settings/admin/「开始」菜单/程序/启动/IP.bat" END |
至于你的要放到GHOST文件中,要用GHOSTEXP打开GHO文件,将IP.bat复制到指定目录下并保存。
如双网卡,每个网卡设置2个IP的方法:
@echo off netsh interface ip set address "本地连接" source=static 192.168.0.116 255.255.255.0 gateway=192.168.0.1 gwmetric=auto @echo on pause DEL "C:/Documents and Settings/admin/「开始」菜单/程序/启动/IP.bat" END |
双网卡,每个网卡单ip:
@echo off netsh interface ip set address "本地连接" source=static 192.168.0.16 255.255.255.0 gateway=192.168.0.1 gwmetric=auto @echo on pause DEL "C:/Documents and Settings/admin/「开始」菜单/程序/启动/IP.bat" END |
删除pause后就不会出现确定的对话框
我的素材网 www.bdqn.cc