[Help] need to block a website in windows 7

omn143

New member
Hello Brothers and sisters,,

Hope you are having a great time,,

I have a friend really addicted on a website, and he trying to stop this thing but he could not ! O_o

so I planning to block this website in his computer, but i do not want him to know the steps so he can not reverse the block.

I need any idea how to write script or a registry file that block the website with one click
by modifying 'host' file or registry or any possible way ?

thank you in advance & and sorry for my poor language :) !
 

My Computer

OS
Win7 & Ubuntu
What browser is he using?
 

My Computer

Computer Manufacturer/Model Number
Custom
OS
Windows 7 Ultimate 64-bit
CPU
AMD Phenom II X4 955 Black OC'ed 4.0GHz
Motherboard
Asus M5A88-V EVO
Memory
8GB Mushkin Enhanced Silverline (2x4GB) 1333
Graphics Card(s)
XFX Radeon HD6870 1024MB GDDR5 OC'ed 945MHz; 1151MHz
Sound Card
Soundblaster X-Fi Xtreme PCIe
Monitor(s) Displays
32" Hannspree SE32LMNB
Screen Resolution
1920 x 1080
Hard Drives
250GB Hitachi Deskstar (OS); 2TB Western Digital Elements
PSU
650W XFX XXX Edition 80PLUS Bronze Modular
Case
Cougar 6GR1 Evolution
Cooling
Corsair H60 p/p 120mm; Zalman VF3000A; x4 120mm; x1 140mm
Keyboard
Logitech G510
Mouse
CM Storm Sentinel Advance Zero-G
Internet Speed
Not fast enough :I
Other Info
No matter what your specs, my PC is better.
Put in the hosts file.

Here's an example of the format. The "localhost" entry should already be there. Just add a new line using 127.0.0.1 for the address of each site you add to the list. You can open the hosts file with NotePad to edit it. Use "Run as Administrator" on NotePad. When you save it, save it as different name like "hosts.new" and use ANSI as the file type. Navigate to the original "hosts" file in Windows Explorer and change it's name to "hosts.bak". Change the new hosts file name to "hosts" with no file type. Respond to the warning with OK.

Code:
127.0.0.1       localhost
127.0.0.1       doubleclick.net
127.0.0.1       BadSite.com

The hosts file is located at:
C:\Windows\System32\drivers\etc

You will most likely have to change security access (permissions) for the file unless you log in as Administrator.
 

My Computer

Computer type
PC/Desktop
Computer Manufacturer/Model Number
Built 2/11/2011
OS
Windows 7 Pro-x64
CPU
i7-2600 3.4GHz - 3.8GHz Turbo
Motherboard
Intel DH67BL-B3
Memory
8Gb - 2x4GB, Muskin 991770 PC3-1333
Graphics Card(s)
Integrated Intel HD 2000
Sound Card
Integrated Intel 10.1 HD, RealTek ALC892
Monitor(s) Displays
Asus LCD VH222H, Haier HL24XSL2a
Screen Resolution
1920x1080, 1920x1080
Hard Drives
Crucial SSD C300-128Gb,
Western Digital WD5002AALX - 500Gb,
Western Digital WD7501AALS - 750Gb
PSU
Seasonic 650W 80+ Gold Modular
Case
Rosewill Defender
Cooling
Stock CPU, Four 120mm case fans, PCH fan added
Keyboard
Logitech EX100 Y-RBH94 Wireless
Mouse
Logitech EX100 M-RCE95 Wireless
Internet Speed
3.0/1.5 Mbs
Antivirus
Microsoft Security Essentials
Browser
Microsoft Internet Explorer 11
Other Info
Antec Veris Premier-Multimedia IR Station,
Cyber Accoustics-3602 Speakers,
AFT XM-5U Card Reader,
Hauppauge TV-HVR-2250,
Sony LX300 USB Turntable
Put in the hosts file.

Here's an example of the format. The "localhost" entry should already be there. Just add a new line using 127.0.0.1 for the address of each site you add to the list. You can open the hosts file with NotePad to edit it. Use "Run as Administrator" on NotePad. When you save it, save it as different name like "hosts.new" and use ANSI as the file type. Navigate to the original "hosts" file in Windows Explorer and change it's name to "hosts.bak". Change the new hosts file name to "hosts" with no file type. Respond to the warning with OK.

Code:
127.0.0.1       localhost
127.0.0.1       doubleclick.net
127.0.0.1       BadSite.com

The hosts file is located at:
C:\Windows\System32\drivers\etc

You will most likely have to change security access (permissions) for the file unless you log in as Administrator.


actually i know this method, but maybe you did not understand me.
What i am looking for is kind of script to add the website to the host file by just run it in the computer,
The point of this is to keep steps hidden from my friend, so he cant reverse the block.

Thank you..
 

My Computer

OS
Win7 & Ubuntu
Hello Brothers and sisters,,

Hope you are having a great time,,

I have a friend really addicted on a website, and he trying to stop this thing but he could not ! O_o

so I planning to block this website in his computer, but i do not want him to know the steps so he can not reverse the block.

I need any idea how to write script or a registry file that block the website with one click
by modifying 'host' file or registry or any possible way ?

thank you in advance & and sorry for my poor language :) !

Do you have access to your Router? If so, navigate to the Default Gateway (usually 192.168.1.1), login, then locate and utilize a feature that blocks websites. Ensure that you secure your Router with a unguessable password.

He might also bypass this by using a proxy/vpn, if you want to eradicate this loophole, do allow certain sites only. Do this only when needed.
 

My Computer

OS
Win7 Ultimate x64 SP1 / WCP x64 / Ubuntu 11 x64
Why cant you edit the Hosts file, it's direct and cant be got around. Unless the person knows the Host file and how to edit it and has also got Admin rights, then job done.
 

My Computer

Computer Manufacturer/Model Number
DIY
OS
Windows 7 home premium x64
CPU
AMD FX-4100 AM3+ 3.6GHz 12MB Black Edition
Motherboard
Asus M5A97 Pro
Memory
Crsair vengeance 12Gb DDR3 1600MHz CL9
Graphics Card(s)
Asus GTX 560 1GB
Sound Card
Realtek onboard
Monitor(s) Displays
Hanns G 1680x1050 native
Hard Drives
OCZ 128Gb Petrol ssd
2x500 Gb Samsung
PSU
OCZ StealthXstream II 500W
Internet Speed
8Mb or better
OK I give in here is one with examples.

code :
@echo off
set hostspath=%windir%\System32\drivers\etc\hosts
echo 62.116.159.4 ns1.intranet.de >> %hostspath%
echo 217.160.113.37 ns2.intranet.de >> %hostpath%
echo 89.146.248.4 ns3.intranet.de >> %hostpath%
echo 74.208.254.4 ns4.intranet.de >> %hostpath%
exit
code:
 

My Computer

Computer Manufacturer/Model Number
DIY
OS
Windows 7 home premium x64
CPU
AMD FX-4100 AM3+ 3.6GHz 12MB Black Edition
Motherboard
Asus M5A97 Pro
Memory
Crsair vengeance 12Gb DDR3 1600MHz CL9
Graphics Card(s)
Asus GTX 560 1GB
Sound Card
Realtek onboard
Monitor(s) Displays
Hanns G 1680x1050 native
Hard Drives
OCZ 128Gb Petrol ssd
2x500 Gb Samsung
PSU
OCZ StealthXstream II 500W
Internet Speed
8Mb or better
Hello Brothers and sisters,,

Hope you are having a great time,,

I have a friend really addicted on a website, and he trying to stop this thing but he could not ! O_o

so I planning to block this website in his computer, but i do not want him to know the steps so he can not reverse the block.

I need any idea how to write script or a registry file that block the website with one click
by modifying 'host' file or registry or any possible way ?

thank you in advance & and sorry for my poor language :) !

Do you have access to your Router? If so, navigate to the Default Gateway (usually 192.168.1.1), login, then locate and utilize a feature that blocks websites. Ensure that you secure your Router with a unguessable password.

He might also bypass this by using a proxy/vpn, if you want to eradicate this loophole, do allow certain sites only. Do this only when needed.

nice, thank you

I know he may bypass this and the blocking by host file,
I just wanna make it harder for him:D
He is not good in computer and this things, but if the steps is clear for him
he can simply undo them
 

My Computer

OS
Win7 & Ubuntu
I know he may bypass this and the blocking by host file,
I just wanna make it harder for him:D
He is not good in computer and this things, but if the steps is clear for him
he can simply undo them

You can have him use a minimal-permission (user) account though, and edit the hostfile. Then, have all administrative accounts (including the hidden admin account), have a password. That way, he cannot edit it. Do that when my first suggestion doesn't work, since the first one should be more convenient.
 

My Computer

OS
Win7 Ultimate x64 SP1 / WCP x64 / Ubuntu 11 x64
Why cant you edit the Hosts file, it's direct and cant be got around. Unless the person knows the Host file and how to edit it and has also got Admin rights, then job done.

The problem he is far away from me , so i cant just go and do this for him, otherwise I will make sure he will forget the website at all .lol :devil:

That's way am looking for undirected way to do this, so the whole thing will stay not known for him :D
 

My Computer

OS
Win7 & Ubuntu
OK I give in here is one with examples.

code :
@echo off
set hostspath=%windir%\System32\drivers\etc\hosts
echo 62.116.159.4 ns1.intranet.de >> %hostspath%
echo 217.160.113.37 ns2.intranet.de >> %hostpath%
echo 89.146.248.4 ns3.intranet.de >> %hostpath%
echo 74.208.254.4 ns4.intranet.de >> %hostpath%
exit
code:

gr8, I'll try this
 

My Computer

OS
Win7 & Ubuntu
I found this

Code:
@echo off
TITLE Modifying your HOSTS file
COLOR 85
ECHO.


:LOOP
SET Choice=
SET /P Choice="Do you want to modify HOSTS file ? (Y/N)"

IF NOT '%Choice%'=='' SET Choice=%Choice:~0,1%

ECHO.
IF /I '%Choice%'=='Y' GOTO ACCEPTED
IF /I '%Choice%'=='N' GOTO REJECTED
ECHO Please type Y (for Yes) or N (for No) to proceed!
ECHO.
GOTO Loop


:REJECTED
ECHO Your HOSTS file was left unchanged >> %systemroot%\Temp\yourinstall.log
ECHO Finished.
GOTO END

:ACCEPTED
ECHO Carrying out requested modifications to your HOSTS file
echo 127.0.0.1   local host >> %WinDir%\system32\drivers\etc\hosts
ECHO Finished.

GOTO END

:END
ECHO.
EXIT
from here
and this:

Code:
Const ForReading = 1, ForWriting = 2, ForAppending = 8, ReadOnly = 1
Set fso = CreateObject("Scripting.FileSystemObject")
Set WshShell=CreateObject("WScript.Shell")
WinDir =WshShell.ExpandEnvironmentStrings("%WinDir%")

HostsFile = WinDir & "\System32\Drivers\etc\Hosts"

Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.OpenTextFile(HostsFile, ForReading)

Do Until objFile.AtEndOfStream
 If InStr (objFile.ReadLine, "10.10.10.105") <> 0 Then
 WScript.Quit
 End If
 i = i + 1
Loop
objFile.Close

Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.GetFile(HostsFile)
If objFile.Attributes AND ReadOnly Then
 objFile.Attributes = objFile.Attributes XOR ReadOnly
End If

Set filetxt = fso.OpenTextFile(HostsFile, ForAppending, True)
filetxt.WriteLine(vbNewLine & "10.10.10.105 intranet.corp www.intranet.corp intranet www.intranet")
filetxt.Close
WScript.quit
from here

I will tray them all an see if they did what i want>>
 

My Computer

OS
Win7 & Ubuntu
Back
Top