Don't Mention it! There's something more for you... I just did some research and added two more features :
- Add Gateway
- Add Primary and Secondary DNS
Heres the complete code :
Code:
@echo OFF
:Start
echo Enter 1 to show TCP/IP Configuration
echo Enter 2 to add IP ADDRESS
echo Enter 3 to add gateway
echo Enter 4 to add dns
echo Enter 5 to Exit
ECHO Enter Choice.
SET /P variable=
IF %variable%==5 exit
IF %variable%==4 GOTO DNSAD
IF %variable%==3 GOTO GWAD
IF %variable%==2 GOTO IPAD
IF %variable%==1 GOTO IPSH
:IPSH
ipconfig /all
GOTO Start
:IPAD
echo Enter IP address in dotted format [ex: 192.168.10.100] :
Set /P variable1=
echo Enter subnet mask in dotted format [ex: 255.255.25.0] :
Set /P variable2=
echo Enter the name of you network connection [ex: Local Area Connection, Lan] :
Set /P variable3=
netsh interface ip add address %variable3% %variable1% %variable2%
GOTO Start
:GWAD
echo Enter the name of you network connection [ex: Local Area Connection, Lan] :
Set /P variable3=
echo Enter gateway in dotted format [ex: 192.168.10.100] :
Set /P variable4=
netsh interface ip add address "%variable3%" gateway=%variable4% gwmetric=2
GOTO Start
:DNSAD
echo Enter the name of you network connection [ex: Local Area Connection, Lan] :
Set /P variable3=
echo Enter primary adns ddress in dotted format [ex: 10.168.115.105] :
Set /P variable5=
echo Enter secondary dns address in dotted format [ex: 10.168.115.105] :
Set /P variable6=
netsh interface ip add dns %varialbe3% %variable5%
netsh interface ip add dns %varialbe3% %variable6% index=2
GOTO Start
Bookmarks