winwins win77通过bat脚本设置ip、dns、wins

番茄系统家园 · 2021-08-28 16:00:17

winwins win77通过bat脚本设置ip、dns、wins

本文通过BAT脚本,实现在WIN7上设置IP等网络信息,以下是示例:

以下是脚本:@%1%2ver|find"5."("")("%~s0","","","",1)()修改本机IP地址*****************************************************************echo**echo*修改本机网卡IP地址*echo*1.静态地址*echo*2.自动获取*echo*****************************************************************:beginset/pn=请输入要设置的网卡类型(1或2):if"%n%"lss"1"echo您输入的网卡不存在!请重新输入!!!if"%n%"gtr"2"echo您输入的网卡不存在!请重新输入!!!echo/if"%n%"lss"1"gotobeginif"%n%"gtr"2"gotobeginif"%n%"equ"1"gotox1if"%n%"equ"2"gotox2:x1echo您选择的是:%n%.以太网:begin1set/pa=请输入静态IP地址(如192.168.1.2):if"%a%"equ""gotobegin1:begin2set/pb=请输入子网掩码(如255.255.255.0):if"%b%"equ""gotobegin2:begin3set/pc=请输入网关地址(如192.168.1.1):if"%c%"equ""gotobegin3:begin4set/pd=请输入DNS地址1(如114.114.114.114):if"%d%"equ""gotobegin4:begin5set/pe=请输入DNS地址2(如211.138.156.66):if"%e%"equ""gotobegin5:begin6set/pf=请输入WINS地址(如8.8.8.8):if"%f%"equ""gotobegin6netshinterfaceipsetaddress"本地连接"static%a%%b%%c%netshinterfaceipsetdns"本地连接"static%d%primarynulnetshinterfaceipadddns"本地连接"%e%nulnetshinterfaceipsetwins"本地连接"static%f%nulecho静态地址设置成功!!!ping-n5127.0.0.1nulgoto:eof:x2echo选择的是:%n%.自动获取echo*******************************************************echo*IP即将初始化为自动获取状态……*netshinterfaceipsetaddress"本地连接"dhcpnulnetshinterfaceipsetdns"本地连接"dhcpnulecho*******************************************************echoDHCP设置成功!!!ping-n5127.0.0.1nulgoto:eofpause

相关阅读

  • win7系统怎么开通wins服务器 服务器
  • ultimate 英语单词
  • winwins win77通过bat脚本设置ip、dns、wins
  • 免责声明: 凡标注转载/编译字样内容并非本站原创,转载目的在于传递更多信息,并不代表本网赞同其观点和对其真实性负责。如果你觉得本文好,欢迎推荐给朋友阅读;本文链接: https://m.nndssk.com/post/51481.html
    猜你喜欢
    最新应用
    热门应用