Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Need script to turn off the Internet on XP system

Posted on 2012-03-29
11
Medium Priority
?
451 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Cyber Threats to Small Businesses (Part 2)

The evolving cybersecurity landscape presents SMBs with a host of new threats to their clients, their data, and their bottom line. In part 2 of this blog series, learn three quick processes Webroot’s CISO, Gary Hayslip, recommends to help small businesses beat modern threats.

 
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

2017 Webroot Threat Report

MSPs: Get the facts you need to protect your clients.
The 2017 Webroot Threat Report provides a uniquely insightful global view into the analysis and discoveries made by the Webroot® Threat Intelligence Platform to provide insights on key trends and risks as seen by our users.

Question has a verified solution.

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

Preface There are many applications where some computing systems need have their system clocks running synchronized within a small margin and eventually need to be in sync with the global time. There are different solutions for this, i.e. the W3…
Multi-source agreements are important because they set standards that all manufacturers should follow to ensure that devices are compatible with multiple vendors. The multi-source agreement (MSA) is an agreement that establishes how multiple vendors…
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

721 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