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安全错误
数据库的锁怎样保障安全
网贷系统软件开发
数据库查询条件为
关于网络安全的简报大学
为什么要文档化软件开发过程
win7程序服务器组件
重庆南岸区网络安全宣传活动
数据库版块
refseq数据库的优点
华夏恒生互联网科技ETF
网络安全主要干啥
5g网络安全设计
数据库连接设计怎么写
软件开发里面的爪哇是什么
崇明区信息软件开发服务保障
电厂网络安全处置
大学网络技术部 心得
sap销售模块常用数据库表
小说系统软件开发
数据库表的合并工具
认可应用软件开发
亳州汇新思网络技术有限公司
软件开发进阶系列图
金山区第三方软件开发信息推荐
维护网络安全的话
国际版服务器评测
公司网络安全的治理机制是什么
哪项不是数据库设计建议
网络安全项目玩法
数据库中两个视图怎嘛连接
如何投资存储服务器