How to Prevent Any Program from Connecting to Internet in Windows

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.

Block-program-with-windows-firewall-open-firewall

2. In the Firewall window, click on the “Advanced settings” link. This is where you can create and manage firewall rules.

Block-program-with-windows-firewall-advanced-settings

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

Block-program-with-windows-firewall-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”.

Block-program-with-windows-firewall-program

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.

Block-program-with-windows-firewall-program-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”.

Block-program-with-windows-firewall-program-path-modified

7. In this window, select the “Block the connection” option and click “Next”

Block-program-with-windows-firewall-block

8. Now, make sure all three checkboxes are checked and click “Next”.

Block-program-with-windows-firewall-profile

9. Finally, name the new firewall rule and click “Finish”.

Block-program-with-windows-firewall-name-rule

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.

Block-program-with-windows-firewall-created

Unblock Application

If you want to allow the program you just blocked to connected to the internet, you can do it in two ways.

Temporary unblock:

To temporarily disable rule and allow the application, simply right-click on the outbound rule we just created and select the “Disable Rule” option.

Block-program-with-windows-firewall-disable-rule

To block again, select the “Enable Rule” option.

Delete rule:

To delete the rule, all you have to do is right-click on it and select the “Delete” option.

Block-program-with-windows-firewall-delete

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.

Leave a Comment

Scroll to Top