Windows Guides Feed

LocalAreaNetworkIcon How To Control Access to Specific Websites with Parental ControlsAre your children always using Facebook? Or is your brother always using your computer?You will find here a way to control access to websites at certain times.

We will do this in Windows 7 but you can do it in all Windows versions.

This post will use the hosts file and two tasks. The host file is stored in %SystemRoot%\system32\drivers\etc\ and its function is mapping  host names and IP addresses. Before DNS or WINS act the local host do this mapping so is the ideal place for controlling access to Web Pages.

So let start:

Press WinKey + R, type %SystemRoot%\system32\drivers\etc\ and press Enter. You will see something like this:

etcFolder How To Control Access to Specific Websites with Parental Controls

Copy and paste the file twice so you will see this:

hosts2Copy How To Control Access to Specific Websites with Parental Controls

Create a new folder named c:\hosts. Move the two copies of the host file and rename it to host.tmp1 and host.tmp2.

Press WinKey + R, type notepad and press Enter, drag and drop host.tmp1 to the open window:

host1notepad How To Control Access to Specific Websites with Parental Controls

Add the following line to the file 127.0.0.1 www.facebook.com and save it.

Now, when your browser looks for facebook.com it will be redirected to your local machine, making the connection impossible.

The idea behind is using the host file that blocks Facebook whenever you want. We also have to create 2 files, that are going to copy the 2 versions of the host file.

For that reason we open a new notepad, use WinKey + R, type notepad and press Enter.

Type the following line:

xcopy /Y hosts.tmp1 hosts

hostbatfile1 How To Control Access to Specific Websites with Parental Controls

and save it to “1.bat”, don’t forget to use the quotes:

batnotepad1 How To Control Access to Specific Websites with Parental Controls

Repeat the same with host.tmp2 and create a file named 2.bat. The command line is xcopy /Y hosts.tmp2 hosts. Now we have the files that are going to copy the versions of host file when we want. Copy these 4 files into %SystemRoot%\system32\drivers\etc\ so you finally have these:

hostfilesfinal How To Control Access to Specific Websites with Parental Controls

We are going to use the Task Scheduler to execute the bat files.

Type Winkey + R type taskschd.msc /s and press Enter. On the right pane click create basic task. Name it as Restrict Access. Select Daily. Now enter the time you are going to restrict the access to facebook.com. In our case 8:00 pm. Select Start a program and look for 1.bat. You have to type the folder the task is going to start %SystemRoot%\system32\drivers\etc\:

TaskMangerOptions1 How To Control Access to Specific Websites with Parental Controls

Click on Open the properties dialog for this task when I click Finish and press finish. Select the following options:

TaskSettings1 How To Control Access to Specific Websites with Parental Controls

Repeat the same for 2.bat, but in this case use the time you want to start using the Web Page, for example 5:00 pm.

There you have it, access to websites blocked at certain times.

If you’re not into scripting or doing things as manually as this, be sure to check out the User Accounts and Parental Controls Series (written for Vista but also works for Windows 7.)



 How To Control Access to Specific Websites with Parental Controls

About Angel Luis

I am an Engineer of Telecommunications that love computers. My first computer was a Commodore 16kb, about 25 years ago and since then I am always fighting computers problems. Please visit my entries and ask me about whatever problem you have, I will be pleased to help you. My email is discoveryourpc [at] gmail [dot] com. You can follow me on twitter @agenlu or read my blog www.discoveryourpc.net

Free PC tips by email

Search Windows Guides




Comments

  • http://brilliantazure.com/ Azure

    thanks for the knowledge…

    • Boxer-z4in

      pure excellence

  • http://discoveryourpc.net Angel Luis

    Thank you for the comment.

  • Sal Bass

    I tried these instructions but my system is XP. I got a Blue Screen. Yikes!!! Should this work with XP?

    • http://richr.org/ Rich

      I haven’t personally tested this on XP but it should work. Can you check the system log and give us the details of the blue screen in the forums? We can help you troubleshoot from there.

    • http://discoveryourpc.net Angel

      Thanks for the comment Sal. Please go to the forums and let us know what has happens. It should work on Windows XP.

  • Kgjones02

    hi, good article but i’m having some trouble with it at the moment. For some reason the bat file wont run, even if i try to run it manually within the %SystemRoot%system32driversetc folder. I am using my admin acct but everytime I click on either 1.bat or 2.bat a screen pops up and says access denied. if anyone can help me out with this it will be much appreciated. thanks

    • http://discoveryourpc.net Angel

      I think that your problem is related to how Windows 7 acts about the security in that folder.

      If you are an admin you can change the properties on the Security tab so you are not going to have problems with that.

      If you are still having problems please leave a comment and I will change the article.


Computer tips in your inbox
Sign up for the Windows Guides newsletter to get PC tips and access to free Windows books (More details)

Enter your email address:
 

Popular Guides

See which sites have been visited on your PC (even if private browsing mode is used)

Create a Windows 7 System Repair Disc

Best Free Anti-malware

Hibernate vs. Sleep vs. Shut-Down

i3, i5, and i7; Dual, Quad, Hexa Core Processors. How to they Differ?

Intel's Ivy Bridge Processor: new Features

Submit Your Tip
Submit your computer tip to us; receive full credit for all published tips

Windows Guides on Facebook