I'm getting this error in bold and I'm new to batch code. It should change my static IP based on the option I chose A,B or C. "Invalid address parameter (1). It should be a valid IPv4 address."
Here is my code below.
@echo off
echo Choose:
echo [A] Set ABQ Static IP
echo [B] Set GJ Static IP
echo [B] Set PB Static IP
echo.
:choice
SET /P C=[A,B,C]?
for %%? in (A) do if /I "%C%"=="%%?" goto A
for %%? in (B) do if /I "%C%"=="%%?" goto GJ
for %%? in (C) do if /I "%C%"=="%%?" goto PB
goto choice
:A
@echo off
echo "Please enter Static IP Address Information"
echo "Static IP Address:"
set /p IP_Addr=10.1.4.53
echo "Default Gateway:"
set /p D_Gate=10.1.4.1
echo "Subnet Mask:"
set /p Sub_Mask=255.255.255.0
echo "Setting Static IP Information"
netsh interface ip set address "Local Area Connection" static %IP_Addr% %Sub_Mask% %D_Gate% 1
netsh int ip show config
pause
goto end
:GJ
@echo off
echo "Please enter Static IP Address Information"
echo "Static IP Address:"
set /p IP_Addr=10.1.2.53
echo "Default Gateway:"
set /p D_Gate=10.1.2.1
echo "Subnet Mask:"
set /p Sub_Mask=255.255.255.0
echo "Setting Static IP Information"
netsh interface ip set address "Local Area Connection" static %IP_Addr% %Sub_Mask% %D_Gate% 1
netsh int ip show config
pause
goto end
:PB
@echo off
echo "Please enter Static IP Address Information"
echo "Static IP Address:"
set /p IP_Addr=10.1.1.5
echo "Default Gateway:"
set /p D_Gate=10.1.1.254
echo "Subnet Mask:"
set /p Sub_Mask=255.255.255.0
echo "Setting Static IP Information"
netsh interface ip set address "Local Area Connection" static %IP_Addr% %Sub_Mask% %D_Gate% 1
netsh int ip show config
pause
goto end
:end