@echo off :startIP set /p source=S or D or C or P or E: echo source:%source% if /i "%source%" == "S" ( goto staticIP ) if /i "%source%" == "D" ( goto dhcpIP ) if /i "%source%" == "C" ( goto ipconfig ) if /i "%source%" == "P" ( goto ping ) if /i "%source%" == "e" ( goto exitSet ) :staticIP set /p IP=IP: netsh interface ip set address name="本地连接" source=static addr=%IP% mask=255.255.255.0 gateway=192.168.10.1 goto startIP :dhcpIP netsh interface ip set address name="本地连接" source=dhcp goto startIP :ipconfig ipconfig goto startIP :ping set /p TARGET=TARGET: ping %target% goto startIP :exitSet exit @Rem @netsh interface ip set dns name="本地连接" source=static addr=192.168.10.1
啦啦啦
时间: 2024-12-29 07:22:24