Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Need script to turn off the Internet on XP system

Posted on 2012-03-29
11
Medium Priority
?
457 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 200 total points
ID: 37783816
0
 
LVL 9

Assisted Solution

by:Ashok Dewan
Ashok Dewan earned 200 total points
ID: 37783818
0
 
LVL 6

Assisted Solution

by:HomerTNachoCheese
HomerTNachoCheese earned 400 total points
ID: 37783830
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
 The Evil-ution of Network Security Threats

What are the hacks that forever changed the security industry? To answer that question, we created an exciting new eBook that takes you on a trip through hacking history. It explores the top hacks from the 80s to 2010s, why they mattered, and how the security industry responded.

 
LVL 9

Author Comment

by:macarrillo1
ID: 37783880
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
ID: 37783915
@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
 
LVL 6

Assisted Solution

by:HomerTNachoCheese
HomerTNachoCheese earned 400 total points
ID: 37783946
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
ID: 37783964
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
ID: 37784074
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 1200 total points
ID: 37784613
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
ID: 37844333
@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
ID: 37844784
Your welcome
0

Featured Post

Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Using in-flight Wi-Fi when you travel? Business travelers beware! In-flight Wi-Fi networks could rip the door right off your digital privacy portal. That’s no joke either, as it might also provide a convenient entrance for bad threat actors.
This article offers some helpful and general tips for safe browsing and online shopping. It offers simple and manageable procedures that help to ensure the safety of one's personal information and the security of any devices.
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…
Suggested Courses

824 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