3 Simple Ways to
Share What You Make

With Instructables you can share what you make with the world — and tap into an ever-growing community of creative experts.

PhotosPhotos

Share one or more photos of a project, recipe, or whatever you've made, quickly and easily.

Step by StepStep-By-Step

Share your step-by-step photos with text instructions of what you made so others can do it too!

VideoVideo

Share your how-to video. You'll need your embed code from a video site such as YouTube.

Make a Self-Writing Site Blocker

Make a Self-Writing Site Blocker
This will make a batch file that creates the hosts file to block any sites you don't like. If you can trick your friends then you can even block sites they use just for fun.

A lot of this information is a compilation of what I have asked for or read about on this website. It also comes from my boredom at work when I am messing around with the computers. I will link the Instructables that have helped me accomplish the creation of this file.

The basic idea of editing the file comes from How to "hack this site".
Help with coding came from Neodudeman.

I am not liable for any trouble you cause with this. Use it however you want to mess with computers, but if something goes wrong...well, I warned you.
 
Remove these adsRemove these ads by Signing Up
 

Step 1Batch Basics

Batch Basics
Ok so it does help to know some batch file basics. Right now I will explain what I can.

@echo off - this will make it so that when you open up the batch file, it wont show the commands

echo - any text following this will be shown on the Command Prompt window
ex. echo Hello World (see pic)

Pause - causes the batch file to stop. Displays "Press any key to continue..."

echo. - creates a blank line

@echo off > - starts a new file
ex. @echo off > hosts would create file called "hosts"
If you add .txt at the end, it would make a text file. So @echo off > test.txt would make a text version of the file

>> hosts - used at the end of a line. This causes the text on that line to be added to the file "hosts"
If you made the file something like test.txt in the previous command (@echo off >) then you would put that in this command every time you use it
ex.
@echo off test.txtecho Hi >> test.txt
cd - change the directory

cd\ - change the directory to the main drive (ie. C:\)

cd\%windir% - change the directory to your WINDOWS folder

del - deletes a file

attrib - changes the attributes of a file (hidden/read-only etc)
« Previous StepDownload PDFView All StepsNext Step »
19 comments
Dec 23, 2010. 2:10 PMaccount3r2 says:
how do you un block it?
Nov 3, 2008. 11:41 AMmacweirdo says:
Also, you can type "pause >NUL" (without the quotes) to give a hidden pause. And to answer the "www.google.com" and "google.com" blocking question, to block both, type (star). and the website's name to block (anything).google.com (including google.com).
Jul 22, 2009. 2:06 AMScytheon3 says:
Does this mean you could put echo 0.0.0.0 *.*.* to block every site on the internet
Dec 8, 2009. 7:59 PMArchive555 says:
Not quite sure if that'd work, but if it did, you could just use an asterisk by itself
echo *
Rather than
echo *.*.*.*
Jan 14, 2009. 5:10 AMelmynase says:
what if instead of putting "0.0.0.0", you put the IP adress of an other site, like say youtube.com If you type "www.google.com", will it send you to youtube.com ? thanks any way good instructable
Dec 6, 2008. 4:23 PMArbitror says:
Not working!
Nov 3, 2008. 11:42 AMmacweirdo says:
sry, its (star)(dot). I messed up the comment thing.
Mar 5, 2008. 7:06 PMtrumpkin says:
when i try to open the batch file it closes right away, whats up.
Feb 22, 2008. 4:29 AMNeodudeman says:
Did I ever say "Thanks for the mention! =D" ?

Because I meant to, lol.
Feb 2, 2008. 3:47 PMI HACK says:
how to undo pleez
Dec 28, 2007. 9:10 AMhq says:
del hosts this does not work the user has to push Y enter it say´s would you like to deleate this folder this might work! del hosts-Y
Jul 23, 2007. 3:16 AMmoomoocows says:
i'm having trouble opening the hosts file i open it with note pad and all i get is a line of numbers with a couple periods
Jul 15, 2007. 3:19 AMTHE NEWBIE says:
can u ples make a step that has all u need to type on it?
Jun 28, 2007. 3:38 PMduct tape says:
This is also the reason for many of those 'I can hack' videos. They show you the web site, then they turn the camera off. Then they edit the hosts file, like this:
127.0.0.1         www.site.com127.0.0.1         site.com
So that it points the browser to your own computer to look for the 'index.htm' file, and displays that instead of the real site. So you could make a page where it says "Access: DENIED" really big.
Jun 21, 2007. 12:57 PMhg341 says:
who hoo!!!!!!we i love this
Jun 20, 2007. 3:29 PMjosh92176 says:
Great, not only does this tell you how to make a self writing site blocker it also explains what all the commands do. cool :-)

Pro

Get More Out of Instructables

Already have an Account?

close

All Steps Viewing
View all steps of an Instructable on the same page when you're a Pro Member.

Upgrade to Pro today!
2
Followers
1
Author:Serneum