[Please DO NOT reply to yourself, use the Edit button to edit your post]
I'm really sorry for that zementmischer.
Yeah I was asking for a batch file which should ask in that particular order but when I googled it then I found my mentioned codes that 100% work.
Technically I was asking for an automatic IP changer in batch form which can either ask IPs/Gateway or these can be defined in a batch file at a particular place.
Therefore, I got the latter.
Please consider the following codes:
REM ***** You donít need to change anything below this line! ******
ECHO This fanciness is brought to you by Saman Sadeghi!
ECHO Setting IP Address and Subnet Mask
netsh int ip set address name = "Local Area Connection" source = static addr = %varip% mask = %varsm%
ECHO Setting Gateway
netsh int ip set address name = "Local Area Connection" gateway = %vargw% gwmetric =
ECHO Setting Primary DNS
netsh int ip set dns name = "Local Area Connection" source = static addr = %vardns1%
ECHO Setting Secondary DNS
netsh int ip add dns name = "Local Area Connection" addr = %vardns2%
ECHO Here are the new settings for %computername%:
netsh int ip show config
Now I want to ask one more thing after running the above codes in batch file.
I go to TCP/IP Properties > Advanced
and I found 10.0.83.65 already entered in Default Gateway
Now the problem is: I want to add one more gateway in Default Gateway
field which is 10.0.83.66 with Metric 50
What additional lines should I add in my batch file in order to do that?
My OS is WIN XP SP3
Thanks in advance.