目录
  • 网站素材
  • PS素材
  • 成语素材
  • 图片素材
  • 名字素材
  • 签名素材
  • 头像素材
  • 技术笔记
  • 首页 > 技术笔记 / 正文

    ghost安装系统后让其自动设置指定IP的方法

    素材 技术笔记 素材网 www.bdqn.cc

     

    @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
    @echo 开始设置IP

    netsh interface ip set address "本地连接" source=static 192.168.0.118 255.255.255.0 gateway=192.168.0.1 gwmetric=auto
    netsh interface ip add address "本地连接" 192.168.0.128 255.255.255.0
    netsh interface ip set dns name="本地连接" source=static 202.96.128.87
    netsh interface ip add dns name="本地连接" 202.96.134.134 index=2

    @echo on
    @echo IP已设置
    @echo off

    pause

    DEL "C:/Documents and Settings/admin/「开始」菜单/程序/启动/IP.bat"

    END

     

    至于你的要放到GHOST文件中,要用GHOSTEXP打开GHO文件,将IP.bat复制到指定目录下并保存。

    如双网卡,每个网卡设置2个IP的方法:

     

    @echo off
    @echo 开始设置IP

    netsh interface ip set address "本地连接" source=static 192.168.0.116 255.255.255.0 gateway=192.168.0.1 gwmetric=auto
    netsh interface ip add address "本地连接" 192.168.0.126 255.255.255.0
    netsh interface ip set dns name="本地连接" source=static 202.96.128.87
    netsh interface ip add dns name="本地连接" 202.96.134.134 index=2
    netsh interface ip set address "本地连接 2" source=static 192.168.0.118 255.255.255.0 gateway=192.168.0.1 gwmetric=auto
    netsh interface ip add address "本地连接 2" 192.168.0.128 255.255.255.0
    netsh interface ip set dns name="本地连接 2" source=static 202.96.128.87
    netsh interface ip add dns name="本地连接 2" 202.96.134.134 index=2

    @echo on
    @echo IP已设置
    @echo off

    pause

    DEL "C:/Documents and Settings/admin/「开始」菜单/程序/启动/IP.bat"

    END

     

    双网卡,每个网卡单ip:

     

    @echo off
    @echo 开始设置IP

    netsh interface ip set address "本地连接" source=static 192.168.0.16 255.255.255.0 gateway=192.168.0.1 gwmetric=auto
    netsh interface ip set dns name="本地连接" source=static 202.96.128.87
    netsh interface ip add dns name="本地连接" 202.96.134.134 index=2
    netsh interface ip set address "本地连接 2" source=static 192.168.0.18 255.255.255.0 gateway=192.168.0.1 gwmetric=auto
    netsh interface ip set dns name="本地连接 2" source=static 202.96.128.87
    netsh interface ip add dns name="本地连接 2" 202.96.134.134 index=2

    @echo on
    @echo IP已设置
    @echo off

    pause

    DEL "C:/Documents and Settings/admin/「开始」菜单/程序/启动/IP.bat"

    END

    删除pause后就不会出现确定的对话框

    TAGS : 

    标签列表

    我的素材网 www.bdqn.cc