WIN7通过BAT脚本设置IP、DNS、WINS
发表于:2024-10-27 作者:千家信息网编辑
千家信息网最后更新 2024年10月27日,本文通过BAT脚本,实现在WIN7上设置IP等网络信息,以下是示例: 以下是脚本:@ echo off%1 %2ver|find "5.">nul&&goto :stmshta _vbscrip
千家信息网最后更新 2024年10月27日WIN7通过BAT脚本设置IP、DNS、WINS
本文通过BAT脚本,实现在WIN7上设置IP等网络信息,以下是示例:
以下是脚本:
@ echo off%1 %2ver|find "5.">nul&&goto :stmshta _vbscript:createobject("shell.application").shellexecute("%~s0","goto :st","","runas",1)(window.close)&goto :eof:stecho/title 修改本机IP地址color 1fecho *****************************************************************echo * *echo * 修改本机网卡IP地址 *echo * 1.静态地址 *echo * 2.自动获取 *echo *****************************************************************:beginset /p n=请输入要设置的网卡类型(1或2):if "%n%" lss "1" echo 您输入的网卡不存在!请重新输入!!!if "%n%" gtr "2" echo 您输入的网卡不存在!请重新输入!!!echo/if "%n%" lss "1" goto beginif "%n%" gtr "2" goto begin if "%n%" equ "1" goto x1if "%n%" equ "2" goto x2:x1echo 您选择的是:%n%.以太网:begin1set /p a= 请输入静态IP地址(如 192.168.1.2):if "%a%" equ "" goto begin1:begin2set /p b= 请输入子网掩码(如 255.255.255.0):if "%b%" equ "" goto begin2:begin3set /p c= 请输入网关地址(如 192.168.1.1):if "%c%" equ "" goto begin3:begin4set /p d= 请输入DNS地址1(如 114.114.114.114):if "%d%" equ "" goto begin4:begin5set /p e= 请输入DNS地址2(如 211.138.156.66):if "%e%" equ "" goto begin5:begin6set /p f= 请输入WINS地址(如 8.8.8.8):if "%f%" equ "" goto begin6netsh interface ip set address "本地连接" static %a% %b% %c%netsh interface ip set dns "本地连接" static %d% primary>nulnetsh interface ip add dns "本地连接" %e%>nulnetsh interface ip set wins "本地连接" static %f%>nulecho 静态地址设置成功!!!ping -n 5 127.0.0.1>nulgoto:eof:x2echo 选择的是:%n%.自动获取echo *******************************************************echo * IP即将初始化为自动获取状态…… *netsh interface ip set address "本地连接" dhcp>nulnetsh interface ip set dns "本地连接" dhcp>nulecho *******************************************************echo DHCP设置成功!!!ping -n 5 127.0.0.1>nulgoto:eofpause
输入
地址
网卡
静态
脚本
成功
本机
选择
以太网
信息
状态
示例
类型
网关
网络
以太
子网
数据库的安全要保护哪些东西
数据库安全各自的含义是什么
生产安全数据库录入
数据库的安全性及管理
数据库安全策略包含哪些
海淀数据库安全审计系统
建立农村房屋安全信息数据库
易用的数据库客户端支持安全管理
连接数据库失败ssl安全错误
数据库的锁怎样保障安全
恩施行业专业软件开发
项目管理服务器怎么调试
html数据库 sql
软件开发工具答案
电子政务网络安全访问
数据库 <
计算机网络技术测试卷
网络安全禁止行为有哪些
网络安全教育一句话
网络安全应急演记录表
电子商务所运用的网络技术
考虫数据库
值得学习的网络技术
福州社交软件开发
中国服务器2021出货量排名
服务器1 核1G和2G区别
nt数据库简介
华为手机数据库严重损坏
鱼类照片数据库
荔湾软件开发专业院校
服务器网络监控工具
车联网网络安全白皮书2019
电子网络安全性
人财保险软件开发待遇
dns服务器修改不了
web前端和网络安全
数据库文件的格式转换
lol新加坡服务器
数据库突然不能查询上一年的数据
局域网必须用服务器吗