Need script to turn off the Internet on XP system

I need to create a script that will turn off or disable the internet on my XP system at a particular time.  Preferably using Scheduler to run a batch command file to disable the internet and run a second batch command file to enable the internet at a later time.

Any help is appreciated.
LVL 9
macarrillo1Asked:
Who is Participating?
 
Rob MinersCommented:
If you are using Internet Explorer you can Disable & Enable Internet Access on the fly with Task Scheduler.
Using this method, will still allow the User Lan Access if in a Workgroup.


Open notepad and copy and paste the lines below into it. Save the file to the root directory "C:" as IEdisAble.reg

---------------<copy below>---------------------------
Windows Registry Editor Version 5.00
 
 [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings]
 "ProxyEnable"=dword:00000001
 "ProxyServer"="127.0.0.1"
 "ProxyOverride"="<local>"

 [HKEY_CURRENT_USER\Software\Policies\Microsoft\Internet Explorer\Control Panel]
 "ConnectionsTab"=dword:00000001

--------------<copy above>----------------------------
The above Registry settings can be invoked from a Batch file with the command

regedit /s C:\IEdisAble.reg

This command will disable Internet Access and remove the Connections Tab view in Internet Explorer so that the settings can't be changed. You can then schedule the Task to run at a given time with Task Sceduler to invoke the Batch file.

You can also use these settings below to restore Internet Access. Just do the same as above remebering to change file names and use Task Scheduler to turn Internet Access back on.

---------------<copy below>---------------------------
Windows Registry Editor Version 5.00
 
 [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings]
 "ProxyEnable"=dword:00000000
 "ProxyServer"="127.0.0.1"
 "ProxyOverride"="<local>"

 [HKEY_CURRENT_USER\Software\Policies\Microsoft\Internet Explorer\Control Panel]
 "ConnectionsTab"=dword:00000000

--------------<copy above>----------------------------
You can hide the files from casual viewing by using the attrib command as seen below.
attrib +h C:\IEdisable.cmd
attrib +h C:\IEenable.cmd
attrib +h C:\IEdisAble.reg
attrib +h C:\IEenAble.reg

Depending on your Security settings you may need to use an Admin account to run the Tasks.
0
WEBINAR: 10 Easy Ways to Lose a Password

Join us on June 27th at 8 am PDT to learn about the methods that hackers use to lift real, working credentials from even the most security-savvy employees. We'll cover the importance of multi-factor authentication and how these solutions can better protect your business!

 
HomerTNachoCheeseCommented:
Do you want to kill all network connections at the same time?

If you use DHCP to get an IP address, you could probably have a script that runs:

ipconfig /release

to kill connections

and run

ipconfig /renew

to get connected again.
0
 
macarrillo1Author Commented:
Would a user be able to click on the wireless icon and connect to another network or will the internet remain off until the internet is turned back on with a second batch file?
0
 
macarrillo1Author Commented:
@HomerTNachoCheese for your solution I would need the IP address of the computer I want to drop from the network and run the command from a different system? Is that how it would work? Or would this solution run from the system that will have its connectivity disabled?

Will this prevent the user from clicking the wireless icon and getting a connection that way?
0
 
HomerTNachoCheeseCommented:
If you are referring to my post, it should remain off until the other batch is ran.  You may need to run
ipconfig /release *wireless*
or
ipconfig /release *
to kill, then
ipconfig /renew *wireless*
to reconnect.

This assumes that your wireless adapter has the name wireless in it.

If the whole purpose of this is something similar to keeping your kids off the Internet during certain hours, I am sure they would eventually learn how to bypass all of this.  You could try getting a timer device for where the router is plugged in for power, and put a lockbox on it.  Maybe plug a surge protector into the wall, plug the timer into the surge protector, and the router into the timer.  Surround the whole thing with a box with a lock on it, with wires coming out one side.  A friend of mine had to take this route because his kids were a little too tech-savvy.
0
 
HomerTNachoCheeseCommented:
Sorry, I was writing while your last post went up.  I think the user can probably click onto any network.  The other guys' solutions may work better if you want to handle it all from within Windows.  You may need to make sure the users just don't have access to be able to enable/disable network adapters if you implement lucky's solution (if I read how his solution works correctly).
0
 
macarrillo1Author Commented:
I will try each of these solutions tonight to see which works best.  I don't expect a permanent solution as I expect my son to eventually figure it out.  But that will give me time to develop a multiple layer approach.
0
 
macarrillo1Author Commented:
@rrjmin0 provided the best solution for what I need.  However, I will likely be using elements from the other solutions provided.

I plan to have his internet go down 5 minutes before curfew with a solution that would allow him to reconnect.  The second script will shut him down for the night.  This way he gets a 5 minute warning and thinks that his system might be infected with something. ;)

Thanks Everyone!  You have given me a lot to work with.
0
 
Rob MinersCommented:
Your welcome
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.