Windows Defender : How to block a program from the internet

If you're running Windows 10 and 11 and want to block a certain program from the Internet so it doesn't share its data with third parties, see how you can do it for free with Windows Defender.

microsoft defender

In Windows, by default all programs you install have access to the internet, with no apparent restrictions.

There are some circumstances, however, where you may need to block a program from accessing the internet. Especially those who illegally install cracked programs often need this feature.

You can block a program by creating an outbound rule in the operating system firewall that will deny Internet access for that program.

This tutorial shows you how to configure Windows Firewall to block a program from connecting to the Internet.

Please note that for the tutorial below you need administrator rights to create, modify and/or delete Windows Firewall rules.

Remove a program's ability to access the internet

step 1 : Run the Windows firewall application. If you don't know how, go to the taskbar and search for either the word Defender or the words “firewall”. Click on the top result.

Alternatively go to Control Panel > Windows Defender Firewall.

If the control panel opens then click on “Advanced settings” until you reach this window:

tcp vs udp windows defender

step 2 : In the firewall program window, you should create an outbound rule for the specific program that you don't want to "talk" to the internet. To do this, right-click on “Outbound rules” and select “Create rule” from the right.

step 3 : In the new help window that will guide you to compose the new outbound rule, to the right of it you will see 4 options for the rule type. Program, port Default, custom.

Select “Program” and click Next, since we are going to block a specific program.

step 4 : Now, select the “This program path” option, click the Browse button, select the exe file of the app you are interested in, and click the “Open” button. This will add the program path to the empty field.

Note: Windows may use environment variables to indicate part of the path. It's normal. For example, you can see %ProgramFiles% used for the Program Files folder path.

step 5 : Under some circumstances, the firewall rule may not work with environment variable path.

So replace the environment variable with the actual path. That is, if you see %ProgramFiles%, replace it with the actual path "C:\Program Files". Click “Next”.

windows defender block 1

step 6 : Select the “Block connection” option and click Next.

step 7 : Select the “Domain”, “Private” and “Public” checkboxes and click Next.

step 8 : Give the new firewall rule a name of your choice and click Finish.

This creates and activates the new firewall rule to block a specific program from accessing the internet.

From now on, the target program cannot connect or access the internet.

Unblock a program online

If you want to allow the blocked program to access the internet, you can either temporarily or permanently unblock it by modifying or deleting the corresponding firewall rule. Here's how to do it.

Temporarily unblock the program
If you want to allow the program to access the internet temporarily, you can disable the rule. To do this, find the firewall rule under Outbound Rules, right-click on it, and select Disable Rule.

When you're done, right-click the rule and select Enable Rule to block it again.

Permanently unblock the program
To permanently allow a blocked program to access the internet, you can simply delete the corresponding firewall rule. To delete the rule, find the firewall rule under Outbound Rules, right-click on it, and select Delete. If a confirmation box appears then click Yes.

Microsoft Store apps
Note that this approach only works for normal win32 applications. If you want to block an app installed using the Microsoft Store, then the example above won't work, and to accomplish that, use the metered connection feature.

iGuRu.gr The Best Technology Site in Greeceggns

Get the best viral stories straight into your inbox!















Written by Dimitris

Dimitris hates on Mondays .....

One Comment

Leave a Reply
  1. May I add the following:

    It IS POSSIBLE that the "cracked program" and in particular the "crack" contains harmful code, so this harmful code CAN bypass blocking, since codes of its kind are reputed to -now- be able to generate another, non-blocked sequence. exe that
    a) not be blocked by any firewall and
    b) to steal information and tokens from banking operations, connections to email accounts, etc.

    So, in my humble opinion: a machine that "runs" such programs SHOULD NEVER be used for banking, connections to essential emails and generally work on things that might be of interest to fraudsters, thieves and miners.

    Hyg. the day before yesterday, for various reasons I was in a courtroom of the Evelpidon courts. There, among other things, was being tried the case of a Civil Engineer who, during lockdown times, gave his nephew his computer for education, because the nephew's PC could not be connected to the internet. And when he rarely did, he couldn't get into his email and the webex he was doing... lesson.

    After the defendant gave it to his nephew, AND his PC started showing the same ... scenes. Malfunctions, attacks on third parties through his router and much more.

    Fortunately (and I don't hide that I was particularly happy) that the Prosecutor and President of the Office accepted the scientific opinion and testimony of the accused's Technical Advisor who explained (in simple words) that i) his ancient (from 2012) router, ii) a little the cracked game he downloaded to his uncle's PC ... a studious kid, they caused damage to his own uncle as well as to third parties with random attacks on unsupervised routers.

Leave a reply

Your email address is not published. Required fields are mentioned with *

Your message will not be published if:
1. Contains insulting, defamatory, racist, offensive or inappropriate comments.
2. Causes harm to minors.
3. It interferes with the privacy and individual and social rights of other users.
4. Advertises products or services or websites.
5. Contains personal information (address, phone, etc.).