UPDATE: I now use K9 on windows (a parental controls app that does the job for me : http://www1.k9webprotection.com/ ) (Posted since I saw some traffic to this page recently).
I recently made the switch from Mac OS X to Windows (I now own a 17'' XPS which is an absolute beast of a machine). I have recently developed a major habit of wasting my time on sites like reddit, facebook (the addiction is rather huge here), gizmodo, engadget and the like. To get work done, it was imperative I used my web browser lesser than usual. Luckily, I found one of the best apps ever written to boost productivity: SelfControl came to my rescue here. SelfControl allows you to type in a list of sites you want to block and you are all set. Essentially, the one stop solution for people with my problem.
I couldn't find a free app on Windows (which sucks) so I decided to go write my own. Of course, this doesn't even match the awesomeness that SelfControl packs in its UI (I use the command line and a text file for user input and SelfControl has absolutely the best user interface for the job) and I still don't have persistence across reboots etc working (* yet).
My "app" (a small script) reads in domains from .list.txt (you can change it in the script) and adds this one line to the System hosts file:
and voila, site is blocked. For running the app, you need to supply no. of minutes blocked as a command line argument. So you would run:
python WinSelfControl.py #number_of_minutes
and it should go block it.
Of course, there are some quirks. For example: www.facebook.com is needed to block facebook. I initally added just facebook.com and it didn't work (probably my misunderstanding of how hosts files work).
Also, this app isn't persistent across shutdowns. If you shut-down in the middle of its execution, you will have to kick out the lines added to the hosts file yourself. So beware!
This was the product of a few hours and at last I can get back to productivity.
I have only tested this on a 64 bit Windows 7 machine. Also, this code looks like spaghetti code and it might break something. So no warranties there.
Source uploaded here: http://shriphani.com/scripts/WinSelfControl.py