Wednesday, May 20, 2009

How To Change Network IP From Batch File






1. Open notepad.
2. Now copy the code that is given below
netsh interface ip set address name="Local Area Connection" source=static addr=192.168.1.100 mask=255.255.255.0netsh interface ip set address name="Local Area Connection" gateway=192.168.1.1 gwmetric=0netsh interface ip set dns name="Local Area Connection" source=static addr=208.67.222.222netsh interface ip add dns name = "Local Area Connection" addr =208.67.220.220

The relevant IP’s are illustrated in the screenshot below, the IP’s that are illustrated are only examples:

3. Now that you have copied the code, paste this in the Notepad. Enter the IP’s as per your requirements and save the file with the extension *.bat

[eminimall]

4. Your batch file is now ready for execution, now double click the batch file that you just created and you will find your network settings configured in a few seconds.

5. Create another batch file using the similar procedure, in this batch file you enter the IP’s that are relevant to your other location.

6. Now you should be having two batch files one for your office network and the other for your home network.

I guess by using this method your life would ease a bit. :) If you have better method then do let me know.

No comments: