Script to change network location in system preference

Hi there,

Because I will use my laptop both at home and at work, which obviously have different network IP configuration settings. Would it be possible to write a script to change network location and then I can put this script in login items so I dun need to change it everytime I login (which I always forgot to do so).

I had setup 2 sets of configuration which called “Home” and “Work”. I had also look into the system preference dictionary but didn’t mention anything about changing location.

Any Help will be deep appreciated.

Many Thanks in advance.

Winston