When not required, you can prevent any program from connecting to the internet with Windows Firewall. It’s pretty simple. Here’s how.
If you are connected to the internet, almost any application can access it without much difficultly. Of course, applications connect to the internet to provide additional features or services, send telemetry, and receive updates.
Though letting applications access the internet without any restriction is not a big problem, for the most part, there might be situations where you need to block or prevent a program from doing so. There may be a number of reasons like the program using up a lot of data, sending excessive telemetry data, etc.
If that’s ever the case and you want to block programs from connected to the internet, you can use the built-in Windows firewall to restrict applications. Here’s how.
Things to Know
The below procedure only works with the regular win32 programs. If you want to restrict modern store or UWP apps, I recommend you enable the metered connection. The metered connection restricts background internet access and updates.
Though the entire configuration is pretty easy, I recommend you follow the steps closely. Do not touch anything else unless you know what you are doing. Mismanaging Windows Firewall rules is the last thing you want.
Steps to Prevent Programs from Connecting to Internet with Windows Firewall
These are the steps to block an application from connecting to the internet in Windows.
1. First, open the start menu, search for “Windows Firewall” and click on the result. Alternatively, you can also use the “control firewall.cpl” run command.
2. In the Firewall window, click on the “Advanced settings” link. This is where you can create and manage firewall rules.
3. Since we want to block an application connecting to the internet, we need to create a new outbound rule. So, right-click on the “Outbound Rules” option and select “New Rule”.
4. You will see a New Outbound Rule Wizard. We want to block a program, so select the “Program” radio option and click “Next”.
5. In this window, click on the “Browse” button, select the application’s exe file, and click on the “Open” button. This will add it to the blank field.
6. If the exe file is in the default folder, Windows tries to replace the absolute link with an environment variable. For example, you can see “%ProgramFiles%” being used for the Programs Files folder path.
However, for whatever reason, the firewall rule won’t work with the environment variable. So, replace the environment variable with the actual path. In my case, I replaced “%ProgramFiles%” with the actual path “C:\Program Files”. Once you are done, click “Next”.
7. In this window, select the “Block the connection” option and click “Next”
8. Now, make sure all three checkboxes are checked and click “Next”.
9. Finally, name the new firewall rule and click “Finish”.
That is it. You can see the new rule in the Firewall window. From now on, the target program cannot connect or access the internet.
If you want to allow the program you just blocked to connected to the internet, you can do it in two ways.
To temporarily disable rule and allow the application, simply right-click on the outbound rule we just created and select the “Disable Rule” option.
To block again, select the “Enable Rule” option.
To delete the rule, all you have to do is right-click on it and select the “Delete” option.
That is all. It is that simple to block an application from connecting to the internet with Windows Firewall. If you are stuck or need some help, comment below and I will try to help as much as possible.