Copy Code code as follows:
@echo off
REM #----------------------------------
REM # interface IP configuration
REM #----------------------------------
echo "=========ip control management =========="
echo "=> D: Automatically get IP"
echo "=> H: Bedroom IP address: 66.168.1.8"
echo "=> r: Corporate network IP address: 192.168.250.173"
echo "Please enter the corresponding ordinal d,h,r and press ENTER to end:"
set/p ch=
If%ch%== "" echo "You input null" &goto:eof
Set Case=d,h,t,w>nul
echo%case%|findstr "\<%ch%\>" >nul&if errorlevel 1 Goto:err
Goto%ch%
Goto ERR
: H
:: "Bedroom"
echo "Configure home IP address gateway,please wait second ..."
@netsh int IP set Address "Local Area Connection" static 66.168.1.8 255.255.255.0 66.168.1.1 1 >nul
@netsh int IP set DNS "Local Area Connection" Static 66.168.1.1 PRIMARY >nul
Echo Home IP Configure is done
Goto:eof
: R
:: "Company Network"
echo "Configure transport IP address gateway,please second ..."
@netsh int IP set Address "Local Area Connection" static 192.168.250.173 255.255.255.0 192.168.250.1 1 >nul
Echo Transport IP Configure is done
Goto:eof
:d
:D HCP "Automatically obtain IP address"
echo "Configure transport IP address gateway,please second ..."
@netsh int IP set Address "Local Area Connection" DHCP >nul
@netsh int IP set DNS "Local Area Connection" DHCP >nul
: Err
:: "Error"
echo your input "%ch%", no this argument! Please input H or w! Game Over
REM # interface IP configuration End