If you want to change the ip address of your system using the batch file use the following scripts
This code should work in XP,Vista and 2003. Vista users have to run the batch file as an administrator.
(Right click the batch file and click “Run as Administrator”)
For Static IP address
Open notepad and enter the following code now you need to save this file as static.bat after saving this file you need to double click on static.bat file to run
Note:- Change the values according to your settings in the following script
:: Enter your static ip address, Subnet Mask and Default Gateway
netsh interface ip set address name = “Local Area Network Connection” source = static addr = 192.168.0.12 mask = 255.255.255.0 gateway = 192.168.0.2 gwmetric = 1
:: Enter your Preferred DNS Server
netsh interface ip set dns name=”Local Area Network Connection” static 24.92.22.90
:: Enter your Alternate DNS Server, if you dont know remove the following line
netsh interface ip add dns name=”Local Area Network Connection” 24.92.22.102 index=2
For DHCP
Open notepad and enter the following code now you need to save this file as dhcp.bat after saving this file you need to double click on dhcp.bat file to run
netsh interface ip set address name=”Local Area Network Connection” source=dhcp
netsh interface ip set dns name=”Local Area Network Connection” source=dhcp register=primary
netsh interface ip set wins name=”Local Area Network Connection” source=dhcp
Incoming search terms:
- batch file to change ip address (82)
- change ip batch (37)
- how to change ip address using batch file (33)
- change ip address batch file (32)
- batch file to set ip address (31)
- batch file to change ip address windows 7 (29)
- change ip bat (25)
- batch file for changing ip address (23)
- script to change ip address xp (20)
- script change ip address xp (18)
Very helpful – thanks.
Thanks this is a life saver!
“For Static IP address”
“For DHCP”
I do not use DHCP. What about dynamic IP address??
thanks dear, but from where can I download that batch file
Not what I was looking for, but teached me a thing and is very usefull at my temporary location. THX !
do you know a batch command to add a random ip to local area connection speciified in a parameter of 100 to 223
and then I need to a dhcp command following and a ipconfig/release command before the random ip
do you know also how to make a batch file loop a specified number of times
change ip dynamic ip batch file downlod link
this is not working for windows 7.
Excellent script. I had to manually retype all the inverted commas / speech marks as for some reason they didn’t copy over properly. I also had to change the name from “Local Area Network Connection” to “Local Area Connection” as that is what it was called on my computer
super!!! thankz!!
i cant understand the code.please some one tell me the code for static,i want to copy the code