网络没有为计算机分配一个网络地址,网络没有为计算机分配一个网络地址是为什么...

把下面的这一段用粘贴到文本文件。然后把文件的扩展名改为IP.BAT 运行一下。就好。

@echo off

title --IP自动设置 --

MODE con: COLS=80 lines=30

color 0a

:main

cls

echo 按提示操作

echo.

echo 要把IP设置为宁基宿舍用的IP 请按 1

echo 要把IP设置为自动获取 请按 2

echo 要退出 请按 3

echo.

@rem 上一句是空一行

set /p choice= 您的选择:

echo.

if %choice%==1 goto ip1

if %choice%==2 goto ip2

if %choice%==3 goto end

if %choice%==4 goto test

goto main

:ip1

echo IP自动设置开始....

echo.

echo 正在设置IP及子网掩码

cmd /c netsh inte***ce ip set address name=本地连接 source=static addr=192.168.1.26 mask=255.255.255.0 gateway=192.168.1.1 gwmetric=1

echo 正在设置DNS服务器

cmd /c netsh inte***ce ip set dns name=本地连接 source=static addr=202.96.128.86 register=PRIMARY

@rem 以上这句为设置DNS为202.96.128.86

echo 正在设置DNS服务器

cmd /c netsh inte***ce ip add dns name=本地连接 addr=202.96.128.166

@rem 以上这句为设置DNS为202.96.128.86

echo 设置完成

pause

exit

if errorlevel 2 goto main

if errorlevel 1 goto end

:ip2

echo IP自动设置开始....

echo.

echo 自动获取IP地址....

netsh inte***ce ip set address name = 本地连接 source = dhcp

echo 自动获取DNS服务器....

netsh inte***ce ip set dns name = 本地连接 source = dhcp

@rem 设置自动获取IP

echo 设置完成

pause

exit

if errorlevel 2 goto main

if errorlevel 1 goto end

:test

netsh inte***ce ip set address name = 本地连接 source = dhcp

netsh inte***ce ip set dns name = 本地连接 source = dhcp

netsh inte***ce ip set wins name = 本地连接 source = dhcp

CHOICE /C YN /M 退出请按 Y,返回菜单请按 N。

if errorlevel 2 goto main

if errorlevel 1 goto end

:end

取消

评论

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值