您好,欢迎来到 - 67学习网 - http://www.67xuexi.com !

借助脚本来修改IP地址

摘要:netsh interface ip add dns name = "以太网" addr = 61.144.56.100netsh interface ip add dns name = "以太网" addr = 202.96.128.68netsh interface ip add dns name = "以太网" addr = 202.96.128.86echo.全部设置完成!@Pausegoto ethernet:3echo 正在进行Ethernet公网静态IP2设置(宿舍网络),请稍等...echo.echo.设置参数为:echo.---echo.ip地址= 192.168.1.33echo.子网掩码=255.255.255.0echo.默认网关=192.168.1.33echo.首选DNS=61.144.56.100echo.---ipconfig /releasenetsh interface ip add address name="以太网" addr=192.168.1.
借助脚本来修改IP地址,标签:电脑常识大全,http://www.67xuexi.com

  netsh interface ip add dns name = "以太网" addr = 61.144.56.100

  netsh interface ip add dns name = "以太网" addr = 202.96.128.68

  netsh interface ip add dns name = "以太网" addr = 202.96.128.86

  echo.全部设置完成!

  @Pause

  goto ethernet

  :3

  echo 正在进行Ethernet公网静态IP2设置(宿舍网络),请稍等...

  echo.

  echo.设置参数为:

  echo.---------------------------

  echo.ip地址= 192.168.1.33

  echo.子网掩码=255.255.255.0

  echo.默认网关=192.168.1.33

  echo.首选DNS=61.144.56.100

  echo.---------------------------

  ipconfig /release

  netsh interface ip add address name="以太网" addr=192.168.1.33 mask=255.255.255.0 gateway=192.168.1.1

  netsh interface ip add dns name = "以太网" addr = 202.106.0.20

  netsh interface ip add dns name = "以太网" addr = 211.147.6.3

  netsh interface ip add dns name = "以太网" addr = 202.106.0.21

  netsh interface ip add dns name = "以太网" addr = 202.105.12.226

  netsh interface ip add dns name = "以太网" addr = 61.144.56.100

  netsh interface ip add dns name = "以太网" addr = 202.96.128.68

  netsh interface ip add dns name = "以太网" addr = 202.96.128.86

  echo.全部设置完成!

  @Pause

  goto enthernet

  :4

  goto main

  @rem 以下是以IP地址自定义批处理

  :ip-selfset

  cls

  echo.您正在执行Ethernet IP地址自定义设置操作!

  :ip1

  cls

  color 13

  echo.IP自定义设置开始....

  echo.

  echo 开始设置IP及子网掩码

  set /p saddr=请输入静态地址:

  if /i "%saddr%"=="" goto ip1

  set /p mask=请输入子网掩码:

  if /i "%mask%"=="" goto ip1

  set /p gateway=请输入默认网关:

  if /i "%gateway%"==""goto ip1

  goto IP_judge

  :IP_judge

  cls

  echo.您输入的IP地址参数如下:

  echo.————————————————————

  echo. IP地址:%saddr%

  echo. 子网掩码:%mask%

  echo. 默认网关:%gateway%

  echo.————————————————————

  echo.

  echo.以上参数正确请按 Y 继续,错误请按N返回重设!

  echo.

  set /p choice= 您的选择:

  if "%choice%"=="N" goto ip1

  if "%choice%"=="n" goto ip1

  if "%choice%"=="Y" goto ipaddr

  if "%choice%"=="y" goto ipaddr goto IP_judge

  echo.

  :ipaddr

  cmd /c netsh interface ip set address name="Local Area connection" source=static addr=%saddr%

  mask=%mask% gateway=%gateway% gwmetric=1 >nul

  goto ipdns

  :ipdns

  cls

  echo 开始设置DNS服务器

  set /p dnsaddr=请输入DNS服务器:

  if /i "%dnsaddr%"=="" goto :ipdns

  @rem 以下语句设置DNS

  cmd /c netsh interface ip set dns name="Local Area connection" source=static addr=%dnsaddr%

  register=PRIMARY >nul

  echo.开始设置DNS备用服务器

  set /p dnsaddr2=请输入备用DNS服务器:

  if /i "%dnsaddr2%"=="" goto :ipdns

  goto DNS_judge

  :DNS_judge

  cls

  echo.

  echo.——————————————————————————

  echo.

  echo. DNS首选服务器:%dnsaddr%

  echo.

  echo. DNS备用服务器: %dnsaddr2%

  echo.

  echo.——————————————————————————

  echo.以上DNS参数正确请按Y继续,否则请按N返回重设!

  echo.

  set /p choice= 您的选择:

  if "%choice%"=="N" goto ipdns

  if "%choice%"=="n" goto ipdns

  if "%choice%"=="Y" goto ipdns2

  if "%choice%"=="y" goto ipdns2

  goto DNS_judge

  :ipdns2

  cmd /c netsh interface ip add dns name="Local Area Connection" addr=%dnsaddr2%

  index=2 >nul

  echo.设置完成 @pause

  goto main

  if errorlevel 2 goto main

  if errorlevel 1 goto end

  :Clear DNS

  cls

  cmd /c ipconfig/flushdns

  echo.DNS缓存清理完成!

  @pause

  goto main

上一页  [1] [2] [3]  下一页


Tag:电脑常识电脑常识大全电脑教程 - 电脑常识

《借助脚本来修改IP地址》相关文章