How to Block Certain Websites From My Command Lineby Fatima Farakh
The command line in Microsoft Windows allows you to quickly run a particular command and receive an immediate response from the computer in the window prompt. Specific websites can be blocked from the command line by running a command to open the Windows Hosts file, a text file in Notepad that controls access to the Internet. Adding the website you wish to block to the Hosts file and saving it will prevent any further access to that specific website domain name.
Click the "Start" button and select "Run."
Type "cmd" without the quotes in the "Open" field and press the "Enter" key or click "OK."
Type "notepad c:\WINDOWS\system32\drivers\etc\hosts" without the quotes in the command line window.
Scroll to the end of the text file in Notepad.
Type "127.0.0.1" without the quotes and then the name of the website you want to block. For example, type "127.0.0.1 website.com" without the quotes to block website.com. Repeat this step for each website you want to block.
Click "File" in the Notepad menu bar and then "Save" to save to file when you are finished adding each website.
Close the command line.