There are times when you need to restrict an application access to the Internet. it could be that you you suspect the application is a malware, or that you don’t want your kids to be able to surf the web on your working PC. In this tutorial, we are going to show you how you can block a program access to the Internet, right from the context menu.
Note: The following tricks will modify your registry. It is best to backup your registry before you proceed. This hack only works in Windows 7 or Vista. It will not work under Windows XP.
The Registry Hack
We are going to change some entries, so when you use the context menu, you will see this menu:
Download the Firewall registry file here
The text in this file is:
Windows Registry Editor Version 5.00[HKEY_CLASSES_ROOTexefileshell][HKEY_CLASSES_ROOTexefileshellAdd To Firewall][HKEY_CLASSES_ROOTexefileshellAdd To Firewallcommand]@="netsh advfirewall firewall add rule name="%1" dir=out action=block program="%1""[HKEY_CLASSES_ROOTexefileshellDelete From Firewall][HKEY_CLASSES_ROOTexefileshellDelete From Firewallcommand]@="netsh advfirewall firewall delete rule name="%1""
Double click the file.
Click Yes to the User Account Control message:
Next, go to the search tool in the Start menu and type “uac” (without quotes)
Drag the slider now to “Never notify” and click Ok.
Restart your computer.
Note: You only need to set the UAC to “Never notify” when you want to add or delete a program from the firewall. Once you have blocked the programs, restore the UAC settings to the defaults.
To illustrate, we are going to add the Internet Explorer to the Firewall and prevent it from accessing the Internet.
1. Use the Find utility in the Start menu, type “Internet Explorer”.
2. Right click on the “Internet Explorer” entry and select “Add To Firewall“.
If you go to the Firewall settings, you will see that Internet Explorer has been added to the Outbound Rules.
Selecting the “Delete From Firewall” will remove the app from the list.
In case you don’t want this feature, download the file UninstallFirewall.reg
The text of this file is:
Windows Registry Editor Version 5.00[-HKEY_CLASSES_ROOTexefileshellAdd To Firewall][-HKEY_CLASSES_ROOTexefileshellDelete From Firewall]
First, unblock all the applications that you have previously blocked.
Secondly, double click the uninstall file. When prompted, press OK. The Firewall options will disappear from the context menu.
Note: Always remember to restore the User Account Control to the default settings.