:: mSQUARED (c)2018@ECHO offTITLE = OLDskool IPswitcher v18.04.30.0SET AdapterName_01="Ethernet"SET IPconfig_01=10.201.162.71 255.255.255.0 10.201.162.1SET IPconfig_02=10.201.151.71 255.255.255.0 10.201.151.1:: ----------------------------------------------------------------------------------------:: Elevate privileges RUN AS ADMINISTRATOR:::: http://blog.spiralofhope.com?p=13553:: https://stackoverflow.com/questions/7044985:: http://stackoverflow.com/a/12264592/1190568:checkPrivilegesNET FILE 1>NUL 2>NULif '%errorlevel%' == '0' ( goto gotPrivileges ) else ( goto getPrivileges ):getPrivilegesif '%1'=='ELEV' (echo ELEV & shift /1 & goto gotPrivileges)setlocal DisableDelayedExpansionset "batchPath=%~0"setlocal EnableDelayedExpansionECHO Set UAC = CreateObject^("Shell.Application"^) > "%temp%\OEgetPrivileges.vbs"ECHO args = "ELEV " >> "%temp%\OEgetPrivileges.vbs"ECHO For Each strArg in WScript.Arguments >> "%temp%\OEgetPrivileges.vbs"ECHO args = args ^& strArg ^& " " >> "%temp%\OEgetPrivileges.vbs"ECHO Next >> "%temp%\OEgetPrivileges.vbs"ECHO UAC.ShellExecute "!batchPath!", args, "", "runas", 1 >> "%temp%\OEgetPrivileges.vbs""%SystemRoot%\System32\WScript.exe" "%temp%\OEgetPrivileges.vbs" %*exit /B:gotPrivilegesif '%1'=='ELEV' shift /1setlocal & pushd .cd /d %~dp0:: ----------------------------------------------------------------------------------------:startCLSECHO -------------------ECHO OLDskool IPswitcherECHO -------------------netsh interface ip show address name=%AdapterName_01%ECHO.ECHO OPTIONS :ECHO.ECHO [1] - %AdapterName_01% IPv4 %IPconfig_01%ECHO [2] - %AdapterName_01% IPv4 %IPconfig_02%ECHO [3] - %AdapterName_01% IPv4 DHCPECHO [4] - Display %AdapterName_01% Current ConfigurationECHO [5] - ExitECHO.SET choice=SET /p choice=Enter selection . . . IF NOT '%choice%'=='' SET choice=%choice:~0,1%IF '%choice%'=='1' GOTO UserSelect1IF '%choice%'=='2' GOTO UserSelect2IF '%choice%'=='3' GOTO UserSelect3IF '%choice%'=='4' GOTO startIF '%choice%'=='5' GOTO endECHO.PAUSE>NUL|SET/P =""%choice%" is not valid, press any key to continue . . . "GOTO start:UserSelect1ECHO.ECHO netsh interface ipv4 set address %AdapterName_01% static %IPconfig_01%netsh interface ipv4 set address %AdapterName_01% static %IPconfig_01%IF %ERRORLEVEL% NEQ 0 PAUSEGOTO start:UserSelect2ECHO.ECHO netsh interface ipv4 set address %AdapterName_01% static %IPconfig_02%netsh interface ipv4 set address %AdapterName_01% static %IPconfig_02%IF %ERRORLEVEL% NEQ 0 PAUSEGOTO start:UserSelect3ECHO.ECHO netsh interface ipv4 set address %AdapterName_01% dhcpnetsh interface ipv4 set address %AdapterName_01% dhcpIF %ERRORLEVEL% NEQ 0 PAUSEGOTO start:endEXIT