Video Screencast Help
Search Video Help Close Back
to help
New in the Rewards Catalog: Vouchers for "Symantec Technical Specialist" and "Symantec Certified Specialist" exams.

Changing Network Settings Automatically

Updated: 14 Mar 2008 | 3 comments
al_v's picture
0 0 Votes
Login to vote

It's not uncommon in today's "connected" world where you find yourself using the same laptop to connect to a number of different networks, typically at home and at work. Sometimes you have to manually change network setting for a network connection.

Here's a way to automate changes to network settings.

There is a way to automate this process to just a single click, all you need to do is create four text files as in example below.

This is a configuration file for use with netsh.exe that will switch all necessary network settings that call for a simple batch file. You can add a shortcut to the desktop so you can run it with just a single click, switching network easily.

"Local Area Connection" is a name of network local connection as displayed in Windows folder, it can have another name and should be replaced appropriately in the scripts below. All IPs are just examples, of course.

Files:

Set_Network_Home.bat

=[cut - file: Set_Network_Home.bat]=====================
netsh -f home.sh

Home.sh

# -----------------------------------------
# Setting up IP-interfaces
# -----------------------------------------
pushd interface ip

# IP interface for "Local Area Connection"

set address name="Local Area Connection" source=static addr=10.10.1.12 mask=255.255.255.0
set address name="Local Area Connection" gateway=10.10.1.10 gwmetric=0
set dns name="Local Area Connection" source=static addr=10.10.1.10 register=PRIMARY
set wins name="Local Area Connection" source=static addr=10.10.1.10

popd
# end

Set_Network_Work.bat

netsh -f work.sh

Work.sh

# -----------------------------------------
# Setting up IP-interfaces
# -----------------------------------------
pushd interface ip

# IP interface for "Local Area Connection"

set address name="Local Area Connection" source=static addr=10.7.10.81 mask=255.255.255.0
set address name="Local Area Connection" gateway=10.7.10.254 gwmetric=0
set dns name="Local Area Connection" source=static addr=10.7.1.2 register=PRIMARY
set wins name="Local Area Connection" source=static addr=10.7.1.11

popd
# end

Comments

erikw's picture
14
Mar
2008
0 Votes 0
Login to vote

Previously

In a not to long past i used a program on my portable to perform this, but that did'nt do the job well.
Hopefully this works better.
I'm going to give it a try.
Thanxsss for posting.

Regards
Erik
www.dvs4sbc.nl

Regards Erik www.DinamiQs.com Dinamiqs is the home of VirtualStorm (www.virtualstorm.org)

*************************************************************
If your issue has been solved, Please mark it as solved
***********

al_v's picture
14
Mar
2008
0 Votes 0
Login to vote

I have used it for a while

I have used it for a while before posting and it worked as great as it simple. It can be done many much with netsh, just execute "netsh.exe dump" to see :)

Same regards
Alex
www.rtsecurity.com

gbromage's picture
17
Mar
2008
0 Votes 0
Login to vote

Great tip

This is an excellent tip - thanks for posting!