zoukankan      html  css  js  c++  java
  • 更改ip地址

    ip

    @echo off
    
    :start
    
    echo ============请输入数字选择下一步操作:
    
    echo ============1:ip设置为192.168.1.101
    
    echo ============2:ip设置为192.168.1.102
    
    echo ============3:设置为DHCP自动获取ip
    
    set /P var=":"
    
    if %var%==1 goto ip101
    
    if %var%==2 goto ip102
    
    if %var%==3 goto ipdhcp
    :ip101
    
    cls
    netsh interface ip set address "本地连接" static 192.168.1.101 255.255.255.0 192.168.1.1
    netsh interface ip set dns "本地连接" static 114.114.114.114 primary
    netsh interface ip add dns "本地连接" 8.8.8.8
    echo **IP设置为192.168.1.101,设置成功**
    echo ------------------------------------------
    
    goto start
    :ip102
    
    cls
    netsh interface ip set address "本地连接" static 192.168.1.102 255.255.255.0 192.168.1.1
    netsh interface ip set dns "本地连接" static 114.114.114.114 primary
    netsh interface ip add dns "本地连接" 8.8.8.8
    echo **IP设置为192.168.1.102,设置成功**
    echo ------------------------------------------
    
    goto start
    :ipdhcp
    
    cls
    
    netsh interface ip set address name="本地连接" source=dhcp
    
    netsh interface ip delete dns "本地连接" all
    
    ipconfig /flushdns
    
    echo **IP设置为DHCP获取,设置成功**
    echo ------------------------------------------
    
    goto start
    

      参考链接

  • 相关阅读:
    对文件的操作
    三级菜单优化
    三级菜单项目
    对字符串的操作(一些重要的方法)
    四、saltstack如何管理对象?
    三、saltstack证书管理
    二、saltstack基础配置
    一、saltstack简介和安装
    set集合
    异常处理语法
  • 原文地址:https://www.cnblogs.com/iupoint/p/13493748.html
Copyright © 2011-2022 走看看