Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

How could I make my webbrowser (chrome.exe) to shut down whenever I visited Facebook.com? 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
1  
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 facebook.com in your hosts file. –  Jin Oct 4 '11 at 16:54
2  
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
add comment

2 Answers

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

c:\windows\system32\drivers\etc

In there you can add

127.0.0.1    www.facebook.com

This will loop back to your computer whenever you try to go to www.facebook.com. 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 ads.facebook.com then you would have your HOSTS file to look like

127.0.0.1    www.facebook.com
127.0.0.1    ads.facebook.com

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
add comment

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
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.