Internet On/Off Switch
(Paul W. 07/14/07)
daughter and son-in-law have a computer that is primarily used for
our grandkids. Because of all the junk that is so easily
displayed on webpages (regardless
of how filtered you make them), they prefer to have
this computer disconnected from the Internet. But sometimes,
like when I'm there, it's nice to have it connected. It's not
real hard to reach behind the computer and disconnect the Ethernet
cable, but it can be a pain, and more so if you want to switch it on
and off frequently. So I wanted to come up with an easy
solution to be able to switch the Internet connection on and off and
also one that the kids couldn't figure out.
I could have shown Mom and Dad how to right click on "My Network Places", then click on properties, the right click on the LAN connection being used, then check the "disable" item. But that's a lot of clicking. Plus you have to reverse the whole process when you want to turn it back on. Not to mention, kids now-a-days would find out how to do this before too long.
So here's the solution I came up with. I made two very small batch files and placed them in a folder on the PC where they can run any time you want to use them. Probably the simplest place to put them on most PCs would be in the C:\Windows\system32 folder or C:\Winnt\system32 depending on your system. (This will not work on Windows 95, 98, or ME. I'm not sure about Windows Vista cause I just haven't used it much yet.) Below are the two batch files with their names and the commands for each:
netoff.bat (this one turns the Internet connection off)
neton.bat (this one turns it back on)
So now with these two batch files in place, all you have to do is go to Start > Run and type: netoff to turn your network connection off. When you're ready to turn it back on go to Start > Run and type: neton and your connection is good again. Even better though (cause this method will leave the last command sitting in the Start > Run box for little eyes to see), is to use a command prompt (DOS prompt) and type the command.
I always keep a command prompt shortcut on my desktop and/or my Quick Launch bar. (Right click on an open space on your Desktop, choose New > shortcut, and type cmd.exe in the location box, and click your way through to finish making the shortcut. Now click and drag this new shortcut to your Quick Launch bar.) So now just click once on this new Quick Launch shortcut, type neton and press Enter.
I've put copies of these two batch files in the same place this Tip is stored (www.gnulife.com/weekly_tips). You'll noticed they are named "netoff.txt" and "neton.txt". Download them and save them in your C:\win...\system32 folder and rename them to "netoff.bat" and "neton.bat" and there you have it.