Question Locked

how to switch the one network to another network through batch files

0 helpful
2 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

iam having local area netwok 192.168.1.1 (Lan) subnetmask is 255.255.255.0

and internet is 10.7.192.81 and subnetmask is 255.255.255.240

and i like to add the dns and gateway also

2 replies

by bizzo

Use the "netsh interface" command

At a prompt, type "netsh interface help" (without the quotes) to get more information.

Here's an example:

netsh interface ip set address name="Local Area Connection" source=static addr=111.222.333.444 mask=255.255.255.255
netsh interface ip set address name="Local Area Connection" gateway=555.666.777.888 gwmetric=0
netsh interface ip set dns name="Local Area Connection" source=static addr=999.111.222.333
netsh interface ip add dns name = "Local Area Connection" addr = 444.555.666.777

This discussion is closed to new replies.