Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How could I make my webbrowser (chrome.exe) to shut down whenever I visited Is this possible? I'm not too good with batches but I try my best ;)

edit: I may need to clairify, I cant do it with host files because they're blocked in my school ;) I have tried... I could If I would replase system 32 and it doesnt seem like a good Idea XD so well I dont actually need a batch file just anytime of file, a vbs would also do.

also content blockers are blocked...

edit 2 (not some invisibility cloaks eather cause cant use these eather, and I want another way around it)

share|improve this question
With a batch file? Do you want it automatic or manually initiated? A batch file can't just run on its own, you'd need some way of launching it. – Shinrai Oct 4 '11 at 16:51
You could write some sort of script that watches the title of the chrome.exe window and kills the process when 'Facebook' appears. I just don't know if it is possible with .bat files. – Duijf Oct 4 '11 at 16:51
Does it have to be a batch script? You could just block in your hosts file. – Jin Oct 4 '11 at 16:54
I should clarify what I meant by my comment, since none of the other comments have hit the same point - what's the GOAL you're trying to accomplish here? You're not making it very clear and the answer may vary by a lot. – Shinrai Oct 4 '11 at 17:02
Your edit doesn't help very much. What's the goal here? You don't want to be able to browse to Facebook? In that case the best solution is just don't browse to Facebook. – Shinrai Oct 4 '11 at 17:54

This doesn't involve batch files per se, but you can use the Invisibility Cloak user script to block views of Facebook or other sites during certain hours.

share|improve this answer

In Windows 7 (and any version of Windows) you can edit your HOSTS file located under


In there you can add

This will loop back to your computer whenever you try to go to If there is specific parts of facebook that you wish to avoid like ads then you can add another like. For example, if facebook's has ads that are located at then you would have your HOSTS file to look like

I know that this is not exactly what you're looking for, but could be a different solution to what you may be trying to accomplish.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .