How To Block An Application Access to Internet From The Context Menu [Windows 7]

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:

win7firewall-Final Context Menu

Download the Firewall registry file here

The text in this file is:

Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\exefile\shell\Add To Firewall]
[HKEY_CLASSES_ROOT\exefile\shell\Add To Firewall\command]
@="netsh advfirewall firewall add rule name=\"%1\" dir=out action=block program=\"%1\""
[HKEY_CLASSES_ROOT\exefile\shell\Delete From Firewall]
[HKEY_CLASSES_ROOT\exefile\shell\Delete From Firewall\command]
@="netsh advfirewall firewall delete rule name=\"%1\""

Double click the file.


Click Yes to the User Account Control message:

win7firewall-User Account Control

win7firewall-Registry Editor Message

Next, go to the search tool in the Start menu and type “uac” (without quotes)

Look For UAC

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.

An Example

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“.

Add Internet Explorer To Firewall

If you go to the Firewall settings, you will see that Internet Explorer has been added to the Outbound Rules.

win7firewall-Advanced Security

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_ROOT\exefile\shell\Add To Firewall]
[-HKEY_CLASSES_ROOT\exefile\shell\Delete 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.

Angel Luis
Angel Luis

I am an Engineer of Telecommunications that love computers. My first computer was a Commodore 16kb, about 25 years ago and since then I am always fighting computers problems. Please visit my entries and ask me about whatever problem you have, I will be pleased to help you.

Subscribe to our newsletter!

Our latest tutorials delivered straight to your inbox