Solved

Need script to turn off the Internet on XP system

Posted on 2012-03-29
11
440 Views
Last Modified: 2012-04-13
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.
0
Comment
Question by:macarrillo1
  • 4
  • 3
  • 2
  • +2
11 Comments
 
LVL 18

Assisted Solution

by:Anil Golamari
Anil Golamari earned 50 total points
Comment Utility
0
 
LVL 9

Assisted Solution

by:Ashok Dewan
Ashok Dewan earned 50 total points
Comment Utility
0
 
LVL 6

Assisted Solution

by:HomerTNachoCheese
HomerTNachoCheese earned 100 total points
Comment Utility
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
 
LVL 9

Author Comment

by:macarrillo1
Comment Utility
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
 
LVL 9

Author Comment

by:macarrillo1
Comment Utility
@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
What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 
LVL 6

Assisted Solution

by:HomerTNachoCheese
HomerTNachoCheese earned 100 total points
Comment Utility
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
 
LVL 6

Expert Comment

by:HomerTNachoCheese
Comment Utility
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
 
LVL 9

Author Comment

by:macarrillo1
Comment Utility
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
 
LVL 14

Accepted Solution

by:
Rob Miners earned 300 total points
Comment Utility
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
 
LVL 9

Author Closing Comment

by:macarrillo1
Comment Utility
@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
 
LVL 14

Expert Comment

by:Rob Miners
Comment Utility
Your welcome
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

MAC Filtering: MAC filtering is like handing a list of names to a doorman. If someone comes to the door and mentions a name, this name is checked by the doorman on his list and granted or denied access by this. This means that if someone menti…
This subject  of securing wireless devices conjures up visions of your PC or mobile phone connecting to the Internet through some hotspot at Starbucks. But it is so much more than that. Let’s look at the facts: devices#sthash.eoFY7dic.
This Micro Tutorial will show you how to maximize your wireless card to its maximum capability. This will be demonstrated using Intel(R) Centrino(R) Wireless-N 2230 wireless card on Windows 8 operating system.
Viewers will learn how to connect to a wireless network using the network security key. They will also learn how to access the IP address and DNS server for connections that must be done manually. After setting up a router, find the network security…

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now