@echo off
REM ************************************************************************************************************
REM * ********* ipchange.bat ************ *
REM * changes ip address, mask & and gateway address under netsh *
REM * Created by Stephen Turner - TurnsSoft.Weebly.com *
REM * *
REM * ** Command usage ** *
REM * NETSH INTERFACE IP DEL ADDRESS NAME=[interface name] GATEWAY=[all] *
REM * NETSH INTERFACE IP SET ADDRESS NAME=[interface name] SOURCE=[static] ADDR=[ip address] MASK=[net mask] *
REM * NETSH INTERFACE IP SET ADDRESS NAME=[interface name] SOURCE=[dhcp] *
REM * NETSH INTERFACE IP ADD ADDRESS NAME=[interface name] GATEWAY=[ip address] GWMETRIC=[num] *
REM * *
REM * ** Variable usage ** *
REM * charyn: char entry for Y or N variable option *
REM * stringReturncode: string var to identify current script local running scope *
REM * stringIp= string var for IP ADDRESS entry *
REM * stringMask= string var for SUBNET MASK entry *
REM * stringDg= string var for DEFAULT GATEWAY entry *
REM * intI= Intager count to detect the number of adapters *
REM * boolMask= bool var for net mask change condition *
REM * boolIp= Bool var for error checking of ip & mask addition *
REM * boolGw= Bool var for error checking of default gateway addition *
REM * stringInt*= String var to add temp var for default adapter *
REM * stringInterface= String var for adapter container *
REM * arg*= Container for command line arguments *
REM * stringArgIp= Container for %1 - /ip *
REM * stringArgIpadd= Variable for the ip address *
REM * stringArgMaskadddf= Variable for the network mask *
REM * stringArgMaskadd= Container for - /mask *
REM * stringArgdgdf= Container for the default gateway default entry *
REM * stringArgdg= Variable for the default gateway *
REM * boolArgmask= Bool var for mask conditional statements *
REM * boolArgdg= Bool var for default gateway conditional statements *
REM * boolArgdhcp= Bool var for dhcp *
REM * *
REM ************************************************************************************************************
:HEAD
setlocal enabledelayedexpansion
title= Easy IPChange - Turnssoft.weebly.com
color 0A
set charyn=
set stringReturncode=
set stringIp=
set stringMask=255.255.255.0
set stringDg=
set stringInt0=
set stringInt1=
set stringInt2=
set stringInt3=
set stringInt4=
set stringInt5=
set stringInt6=
set stringInt7=
set stringInt8=
set stringInt9=
set stringInt10=
set stringInterface=
set boolMask=FALSE
set boolIp=FALSE
set boolGw=FALSE
set intI=0
:::ARGS
set arg1=
set arg2=
set arg3=
set arg4=
set arg5=
set arg6=
set stringArgIp=
set stringArgIpadd=
set stringArgMaskadddf=255.255.255.0
set stringArgMaskadd=
set stringArgdgdf=192.168.1.1
set stringArgdg=
set boolArgmask=FALSE
set boolArgdg=FALSE
set boolArgdhcp=FALSE
:ARGSCHECK
set arg1=%1
set arg2=%2
set arg3=%3
set arg4=%4
set arg5=%5
set arg6=%6
if defined arg1 (GOTO ARGS)
if not defined arg1 (GOTO TITLE)
:ARGS
if /I "%arg1%"=="/?" (GOTO HELPARGS)
if /I "%arg1%"=="/help" (GOTO HELPARGS)
if /I "%arg1%"=="/about" (GOTO HELPARGSABOUT)
if /I "%arg1%"=="/ip" (GOTO ARGSMAIN)
if /I "%arg1%"=="/dhcp" (GOTO ARGSDHCP)
GOTO HELPARGSINVALID
:ARGSDHCP
set boolArgdhcp=TRUE
GOTO MAIN
:ARGSMAIN
set stringReturncode=ARGSMAIN
set stringArgIp=%arg1%
if defined arg2 (set stringArgIpadd=%arg2%) else (echo %0 %1 : [MISSING IP ADDRESS]) & (GOTO QUIT)
::/MASK
if /I "%arg3%"=="/mask" (
if defined arg4 (set boolArgmask=TRUE) & (set stringArgmask=%arg3%) & (set stringArgmaskadd=%arg4%) else (echo %0 %1 %2 %3 : [MISSING SUBNET MASK ADDRESS]) & (GOTO QUIT)
if /I "%arg5%"=="/dg" (
if defined arg6 (set stringArgdg=%arg5%) & (set stringArgdgadd=%arg6%) & (GOTO ARGSRUN) else (echo not defined) & (GOTO QUIT)
))
if "%boolArgmask%"=="TRUE" (set stringArgdgadd=192.168.1.1) & (GOTO ARGSRUN)
::/dg
if /i "%arg3%"=="/dg" (
if defined arg4 (set boolArgdg=TRUE) & (set stringArgdg=%arg3%) & (set stringArgdgadd=%arg4%) else (echo %0 %1 %2 %3 : [MISSING DEFAULT GATEWAY ADDRESS]) & (GOTO QUIT)
if /I "%arg5%"=="/mask" (
if defined arg6 (set stringArgmask=%arg5%) & (set stringArgmaskadd=%arg6%) & (GOTO ARGSRUN) else (echo not defined) & (GOTO QUIT)
))
if "%boolArgdg%"=="TRUE" (set stringArgmaskadd=255.255.255.0) & (GOTO ARGSRUN)
::/default
if not defined arg4 (
if /i "%arg3%"=="/default" (set stringArgdgadd=192.168.1.1) & (set stringArgmaskadd=255.255.255.0) & (GOTO ARGSRUN) else (echo %0 %1 %2 %3 : incorrect entry) & (GOTO QUIT)
)
echo %0 %1 %2 %3 : incorrect entry & GOTO QUIT
GOTO QUIT
:ARGSRUN
set stringIp=%stringArgIpadd%
set stringDg=%stringArgdgadd%
set stringMask=%stringArgmaskadd%
GOTO MAIN
:ARGSRUN2
color E2
echo Clearing interface....
netsh interface ip del address name=%stringInterface% gateway=all
echo Setting ip address ^& mask....
netsh interface ip set address name=%stringInterface% source=static addr=%stringIp% mask=%stringMask%
if ERRORLEVEL 1 set boolIp=TRUE
echo Setting gateway....
netsh interface ip add address name=%stringInterface% gateway=%stringDg% gwmetric=2
if ERRORLEVEL 1 set boolGw=TRUE
ping -n 2 127.0.0.1>nul
GOTO FINAL
:ARGSRUN3
color E2
set stringIp=DHCP
set stringDg=DHCP
set stringMask=DHCP
echo Clearing interface....
netsh interface ip del address name=%stringInterface% gateway=all
echo Setting adapter for dhcp....
netsh interface ip set address name=%stringInterface% source=dhcp
ping -n 2 127.0.0.1>nul
GOTO FINAL
:TITLE
set stringReturncode=TITLE
set charYn=
cls
echo.
echo ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»
echo º º
echo º IP CHANGE º
echo º º
echo ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ
echo.
GOTO MAIN
:MAIN
color E2
echo Scanning default adapter names.....
echo.
ipconfig /all | find "Local Area Connection:">nul
if errorlevel 1 (echo LOCAL AREA CONNECTION: FALSE) else (echo LOCAL AREA CONNECTION: TRUE) & (set /a intI=intI+1) & (set stringInt0="LOCAL AREA CONNECTION")
ipconfig /all | find "Local Area Connection 1">nul
if errorlevel 1 (echo LOCAL AREA CONNECTION 1: FALSE) else (echo LOCAL AREA CONNECTION 1: TRUE) & (set /a intI=intI+1) & (set stringInt1="LOCAL AREA CONNECTION 1")
ipconfig /all | find "Local Area Connection 2">nul
if errorlevel 1 (echo LOCAL AREA CONNECTION 2: FALSE) else (echo LOCAL AREA CONNECTION 2: TRUE) & (set /a intI=intI+1) & (set stringInt2="LOCAL AREA CONNECTION 2")
ipconfig /all | find "Local Area Connection 3">nul
if errorlevel 1 (echo LOCAL AREA CONNECTION 3: FALSE) else (echo LOCAL AREA CONNECTION 3: TRUE) & (set /a intI=intI+1) & (set stringInt3="LOCAL AREA CONNECTION 3")
ipconfig /all | find "Local Area Connection 4">nul
if errorlevel 1 (echo LOCAL AREA CONNECTION 4: FALSE) else (echo LOCAL AREA CONNECTION 4: TRUE) & (set /a intI=intI+1) & (set stringInt4="LOCAL AREA CONNECTION 4")
ipconfig /all | find "Local Area Connection 5">nul
if errorlevel 1 (echo LOCAL AREA CONNECTION 5: FALSE) else (echo LOCAL AREA CONNECTION 5: TRUE) & (set /a intI=intI+1) & (set stringInt5="LOCAL AREA CONNECTION 5")
ipconfig /all | find "Local Area Connection 6">nul
if errorlevel 1 (echo LOCAL AREA CONNECTION 6: FALSE) else (echo LOCAL AREA CONNECTION 6: TRUE) & (set /a intI=intI+1) & (set stringInt6="LOCAL AREA CONNECTION 6")
ipconfig /all | find "Local Area Connection 7">nul
if errorlevel 1 (echo LOCAL AREA CONNECTION 7: FALSE) else (echo LOCAL AREA CONNECTION 7: TRUE) & (set /a intI=intI+1) & (set stringInt7="LOCAL AREA CONNECTION 7")
ipconfig /all | find "Local Area Connection 8">nul
if errorlevel 1 (echo LOCAL AREA CONNECTION 8: FALSE) else (echo LOCAL AREA CONNECTION 8: TRUE) & (set /a intI=intI+1) & (set stringInt8="LOCAL AREA CONNECTION 8")
ipconfig /all | find "Local Area Connection 9">nul
if errorlevel 1 (echo LOCAL AREA CONNECTION 9: FALSE) else (echo LOCAL AREA CONNECTION 10: TRUE) & (set /a intI=intI+1) & (set stringInt9="LOCAL AREA CONNECTION 9")
ipconfig /all | find "Local Area Connection 10">nul
if errorlevel 1 (echo LOCAL AREA CONNECTION 10: FALSE) else (echo LOCAL AREA CONNECTION 10: TRUE) & (set /a intI=intI+1) & (set stringInt10="LOCAL AREA CONNECTION 10")
ping -n 1 172.0.0.1>nul
cls
echo.
if NOT "%intI%"=="1" GOTO CONFINT
echo The following network adapter was found:
if defined stringInt0 (echo %stringInt0%) & (set stringInterface=%stringInt0%)
if defined stringInt1 (echo %stringInt1%) & (set stringInterface=%stringInt1%)
if defined stringInt2 (echo %stringInt2%) & (set stringInterface=%stringInt2%)
if defined stringInt3 (echo %stringInt3%) & (set stringInterface=%stringInt3%)
if defined stringInt4 (echo %stringInt4%) & (set stringInterface=%stringInt4%)
if defined stringInt5 (echo %stringInt5%) & (set stringInterface=%stringInt5%)
if defined stringInt6 (echo %stringInt6%) & (set stringInterface=%stringInt6%)
if defined stringInt7 (echo %stringInt7%) & (set stringInterface=%stringInt7%)
if defined stringInt8 (echo %stringInt8%) & (set stringInterface=%stringInt8%)
if defined stringInt9 (echo %stringInt9%) & (set stringInterface=%stringInt9%)
if defined stringInt10 (echo %stringInt10%) & (set stringInterface=%stringInt10%)
echo.
ping -n 2 127.0.0.1>nul
if defined %1 GOTO ARGSRUN2
GOTO SETIP
:CONFINT
color 0A
set stringReturncode=CONFINT
set charYn=
set stringInterface=
cls
echo.
echo ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
echo IP CHANGE
echo.
echo ADAPTER: %stringInterface%
echo IP ADDRESS: %stringIp%
echo SUBNET MASK: %stringMask%
echo DEFAULT GW: %stringDg%
echo.
echo ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
echo.
echo ÍÍÍÍÍÍÍThe following network adapter names were found....
ipconfig /all | find "Ethernet adapter"
echo.
echo Enter the adapter name you want to configure.
echo For example: local area connection 1
set /p stringInterface= ENTER THE ADAPTER NAME:
if "%stringInterface%"=="" GOTO HELP2
echo.
echo ADAPTER NAME= %stringInterface%
set /p charYn= Save entry? [Y/N]:
if "%charYn%"=="" GOTO HELP2
if /I "%charYn%"=="n" GOTO CONFINT
if /I "%charYn%"=="y" (set stringInterface="%stringInterface%") & (GOTO SETIP)
GOTO HELP3
:SETIP
color 0A
if defined arg1 (GOTO RUN)
set stringReturncode=SETIP
set charYn=
set stringIp=
cls
echo.
echo ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
echo IP CHANGE
echo.
echo ADAPTER: %stringInterface%
echo IP ADDRESS: %stringIp%
echo SUBNET MASK: %stringMask%
echo DEFAULT GW: %stringDg%
echo.
echo ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
echo.
set /p stringIp= Enter an IP address:
if "%stringIp%"=="" GOTO HELP2
echo.
echo IP ADDRESS: %stringIp%
set /p charYn= Save entry? [Y/N]:
if "%charYn%"=="" GOTO HELP2
if /I "%charYn%"=="n" GOTO SETIP
if /I "%charYn%"=="y" (echo.) & (echo IP ADDRESS: %stringIp% SAVED) & (ping -n 2 127.0.0.1>nul) & (GOTO SETMASK)
GOTO HELP3
:SETMASK
color 0A
if "%boolMask%"=="TRUE" GOTO SETMASK2
set stringReturncode=SETMASK
set charYn=
cls
echo.
echo ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
echo IP CHANGE
echo.
echo ADAPTER: %stringInterface%
echo IP ADDRESS: %stringIp%
echo SUBNET MASK: %stringMask%
echo DEFAULT GW: %stringDg%
echo.
echo ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
echo.
echo SUBNET MASK: %stringMask%
set /p charYn= Save entry [Y/N]:
if "%charYn%"=="" GOTO HELP2
if /I "%charYn%"=="n" GOTO SETMASK2
if /I "%charYn%"=="y" (echo.) & (echo SUBNET MASK: %stringMask% SAVED) & (ping -n 2 127.0.0.1>nul) & (GOTO SETDG)
GOTO HELP3
:SETMASK2
color 0A
set stringReturncode=SETMASK2
set charYn=
set stringMask=
cls
echo.
echo ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
echo IP CHANGE
echo.
echo ADAPTER: %stringInterface%
echo IP ADDRESS: %stringIp%
echo SUBNET MASK: %stringMask%
echo DEFAULT GW: %stringDg%
echo.
echo ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
echo.
set /p stringMask= Enter the subnet mask:
if "%stringMask%"=="" GOTO HELP2
echo.
echo SUBNET MASK: %stringMask%
set /p charYn= Save entry [Y/N]:
if /I "%charYn%"=="" GOTO HELP2
if /I "%charYn%"=="n" GOTO SETMASK2
if /I "%charYn%"=="y" (echo.) & (echo SUBNET MASK: %stringMask% SAVED) & (ping -n 2 127.0.0.1>nul) & (GOTO SETDG)
GOTO HELP3
:SETDG
color 0A
set stringReturncode=SETDG
set charYn=
set stringDg=
cls
echo.
echo ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
echo IP CHANGE
echo.
echo ADAPTER: %stringInterface%
echo IP ADDRESS: %stringIp%
echo SUBNET MASK: %stringMask%
echo DEFAULT GW: %stringDg%
echo.
echo ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
echo.
set /p stringDg= Enter a value for the Default Gateway:
if "%stringDg%"=="" GOTO HELP2
echo.
echo DEFAULT GATEWAY: %stringDg%
set /p charYn= Save entry [Y/N]:
if /I "%charYn%"=="" GOTO HELP2
if /I "%charYn%"=="n" GOTO SETDG
if /I "%charYn%"=="y" (echo.) & (echo DEFAULT GATEWAY: %stringDg% SAVED) & (ping -n 2 127.0.0.1>nul) & (GOTO RUN)
GOTO HELP3
:RUN
color E2
set stringReturncode=RUN
set charYn=
if "%boolArgdhcp%"=="TRUE" GOTO ARGSRUN3
cls
echo.
echo ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
echo IP CHANGE
echo.
echo ADAPTER: %stringInterface%
echo IP ADDRESS: %stringIp%
echo SUBNET MASK: %stringMask%
echo DEFAULT GW: %stringDg%
echo.
echo ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
echo.
echo ip %stringIp% > %temp%\ipchange.tmp
echo dg %stringDg% >> %temp%\ipchange.tmp
echo mask %stringMask% >> %temp%\ipchange.tmp
FOR /F "eol=; tokens=1,2,3,4,5 delims=. " %%A in (%temp%\ipchange.tmp) do (
if "%%A"=="ip" (
if %%B GTR 254 GOTO HELP5
if %%C GTR 254 GOTO HELP5
if %%D GTR 254 GOTO HELP5
if %%E GTR 254 GOTO HELP5
if %%E LSS 1 GOTO HELP5
)
if "%%A"=="dg" (
if %%B GTR 254 GOTO HELP6
if %%C GTR 254 GOTO HELP6
if %%D GTR 254 GOTO HELP6
if %%E GTR 254 GOTO HELP6
if %%E LSS 1 GOTO HELP6
)
if "%%A"=="mask" (
if %%B GTR 256 GOTO HELP7
if %%C GTR 256 GOTO HELP7
if %%D GTR 256 GOTO HELP7
if %%E GTR 254 GOTO HELP7
)
)
ping -n 2 127.0.0.1>nul
echo.
ping -n 2 127.0.0.1>nul
echo Clearing interface....
ping -n 2 127.0.0.1>nul
netsh interface ip del address name=%stringInterface% gateway=all
echo Setting ip address ^& mask....
ping -n 2 127.0.0.1>nul
netsh interface ip set address name=%stringInterface% source=static addr=%stringIp% mask=%stringMask%
if ERRORLEVEL 1 set boolIp=TRUE
echo Setting gateway....
ping -n 2 127.0.0.1>nul
netsh interface ip add address name=%stringInterface% gateway=%stringDg% gwmetric=2
if ERRORLEVEL 1 set boolGw=TRUE
ping -n 2 127.0.0.1>nul
GOTO FINAL
:FINAL
color 0A
cls
echo.
echo ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
echo IP CHANGE COMPLETE
echo.
echo ADAPTER: %stringInterface%
echo IP ADDRESS: %stringIp%
echo SUBNET MASK: %stringMask%
echo DEFAULT GW: %stringDg%
echo.
echo ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
echo.
netsh interface ip show address %stringInterface%
echo.
if "%boolIp%"=="TRUE" (echo IP ADDRESS OR MASK COULD NOT BE SET) & (echo POSSIBLE BAD ADDRESS ENTRY) & (echo.)
if "%boolGw%"=="TRUE" (ECHO DEFAULT GATEWAY COUND NOT BE SET) & (ECHO POSSIBLE BAD ADDRESS ENTRY) & (echo.)
pause
GOTO QUIT
:::::::::HELP
:HELP1
REM **** HELP1 FOR OS VER FAILURE
color 4F
echo
echo
echo
echo.
echo ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
echo MASSIVE PROGRAM ERROR
echo VERSION REQUIRED WINDOWS XP
echo.
echo
GOTO QUIT
:HELP2
REM **** HELP2 FOR SYNTAX ERROR - NO COMMAND ENTERED
color 4F
echo
echo.
echo ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
echo ERROR [1] INVALID COMMAND ENTRY
echo NO VALUE ENTERED
echo.
echo
pause
cls
GOTO %stringreturncode%
:HELP3
REM **** HELP3 FOR SYNTAX ERROR - INVALID CHAR YN
color 4F
echo
echo.
echo ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
echo ERROR [2] INVALID COMMAND ENTRY
echo ENTRY NOT RECOGNISED
echo REQUIRED VALUE [Y] FOR YES
echo REQUIRED VALUE [N] FOR NO
echo.
pause
cls
GOTO %stringreturncode%
:HELP4
REM **** HELP4 FOR SYNTAX ERROR - GENERAL INVALAD TEXT
color 4F
echo
echo.
echo ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
echo ERROR [3] INVALID COMMAND ENTRY
echo ENTRY NOT RECOGNISED
echo.
pause
cls
GOTO %stringreturncode%
:HELP5
REM **** HELP5 FOR INVALID IP ADDRESS ENTRY
color 4F
echo
echo ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
echo ERROR [5] INVALID IP ADDRESS ENTRY
echo ENTRY NOT RECOGNISED AS VALID
echo.
pause
GOTO QUIT
:HELP6
REM **** HELP6 FOR INVALID DG ADDRESS ENTRY
color 4F
echo
echo ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
echo ERROR [6] INVALID GATEWAY ADDRESS ENTRY
echo ENTRY NOT RECOGNISED AS VALID
echo.
pause
GOTO QUIT
:HELP7
REM **** HELP6 FOR INVALID MASK ADDRESS ENTRY
color 4F
echo
echo ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
echo ERROR [7] INVALID MASK ADDRESS ENTRY
echo ENTRY NOT RECOGNISED AS VALID
echo.
pause
GOTO QUIT
:::::::::::HELPARGUMENTS
:HELPARGS
color 0A
echo Usage:
echo IPCHANGE [/?]
echo [/HELP]
echo [/ABOUT]
echo [/DHCP]
echo [/IP address] [/DEFAULT]
echo [/IP address] [/MASK netmask]
echo [/IP address] [/MASK netmask] [/DG address]
echo [/IP address] [/DG address]
echo [/IP address] [/DG address] [/MASK netmask]
echo.
echo Description:
echo Statically assign an IP address, network mask and default gateway
echo or enable dhcp on a network adapter.
echo.
echo Parameter List:
echo /HELP Display help and usage options.
echo /ABOUT Display program information.
echo /DHCP Enable DHCP on the adapter.
echo /IP Set IP address.
echo /MASK Set network mask.
echo /DG Set default gateway.
echo /DEFAULT Asign the default value for /MASK ^& /DG
echo Default for /MASK 255.255.255.0
echo Default for /DG 192.168.1.1
echo.
echo Examples:
echo IPCHANGE /DHCP
echo IPCHANGE /IP 192.168.1.21 /DEFAULT
echo IPCHANGE /IP 192.168.1.21 /MASK 255.255.255.0
echo IPCHANGE /IP 192.168.1.21 /MASK 255.255.255.0 /DG 192.168.1.1
echo IPCHANGE /IP 192.168.1.21 /DG 192.168.1.1
echo IPCHANGE /IP 192.168.1.21 /DG 192.168.1.1 /MASK 255.255.255.0
GOTO QUIT
:HELPARGSINVALID
echo %0 %1 : invalid entry
GOTO QUIT
:HELPARGSABOUT
echo.
echo ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»
echo º º
echo º IPCHANGE.BAT º
echo º VERSION - 3 º
echo º CREATED - 27 APR 07 º
echo º DESIGNER - STEPHEN TURNER º
echo º - TURNSSOFT.WEEBLY.COM º
echo º LAST UPDATE - 04 AUG 13 º
echo º º
echo ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ
GOTO QUIT
:QUIT
set stringReturncode=QUIT
if EXIST %temp%\ipchange.tmp del %temp%\ipchange.tmp >nul
GOTO EXIT
:EXIT
set stringReturncode=EXIT
GOTO EOF
:EOF
endlocal