We cross network settings in laptops in two clicks

Original author: Peter Nek
  • Transfer
Now that the Internet is no longer something strange and unattainable for everyone, and laptops have become affordable, there is a problem when at home and in the office there are different Internet connection settings (ip, dns, gateway, proxy, etc.) which must be changed every time. A few weeks ago, they asked me to somehow automate everything, because it had to be done quickly, then google it, I found one of the shareware programs that worked. But I didn’t stop there, I was looking for something simpler, because the minus of these programs was that, firstly, they are paid, secondly, they always hang in memory taking away “precious bytes” from you, and thirdly, downloading from warez sites warez programs run the risk of catching a virus, well, and the last thing why use something extraneous,
Let's get started. We create two text files get_home.bat, get_office.bat in which we write only one line
get_home.bat -> netsh dump> home.cfg
get_office.bat -> netsh dump> office.cfg


Thus, we will create a network settings dump and write them to daddy with scripts. You can read more about the netsh command here , or by typing netsh help. By running these two files each time, respectively, at work and at home (before this you need to manually configure the network for the last time), we determine the basic network settings at our working (and not so) places.
Next we need to create two files. that will cross the settings, let's call them set_home.bat, set_office.bat . Their contents:

set_home.bat -> netsh exec home.cfg
set_office.bat -> netsh exec office.cfg


Almost everything is ready, now you need to put all this in one folder, display the icons on the desktop and use it.
I carefully packed all these files into the archive and placed it on Google code , calling it mr.yans (mister yet another net switcher) . So as someone needs - take it .

P.N. if someone needs such a thing under Linux ask - the possibilities of nix shell are awesome :). Have a nice day.

Also popular now: