|

How To Block A Program From The Internet In Windows 11 (2026)

You can stop one program from reaching the internet in Windows 11 without turning the firewall off.

You do it by adding an outbound rule in Windows Defender Firewall with Advanced Security, and you can switch the rule off again whenever you want.

This guide shows the console steps, a PowerShell option, and how to disable or delete the rule later.

Table of Contents

Quick answer

GoalWhat to do
Open the toolWindows Security > Firewall & network protection > Advanced settings, or press Start, type wf.msc and press Enter
Start a ruleOutbound Rules > Action > New rule
Pick the programRule type Program, then This program path
Block itOn the Action page, select Block the connection
Undo itDisable or delete the rule

Who this is for

This is for anyone who wants one installed program to stop sending data out. To let a wrongly blocked app through instead, see our guide to allowing an app through Windows Firewall.

How an outbound block rule works

Microsoft says Windows Firewall allows all outbound network traffic by default, unless the traffic matches a rule that prohibits it.

That is why you need to create a rule yourself: nothing is blocked on the way out until you add one.

Microsoft describes a block rule for a program as preventing that program from sending outbound traffic on any port.

Before you start

  • Sign in with an administrator account, because Microsoft’s pages say you need administrative rights to open the console.
  • Find the full path of the program, for example the .exe file inside its folder in Program Files.
  • If your work or school manages the PC, policy settings may stop you changing firewall settings, and Microsoft says to contact your administrator.

Microsoft’s own page warns that most people should not dig into the advanced settings and that wrong rule changes can make the system more vulnerable or break apps.

Open Windows Defender Firewall with Advanced Security

There are two ways in, and both open the same window.

  1. Open the Windows Security app and select Firewall & network protection, then select Advanced settings.
  2. Or select Start, type wf.msc and press Enter.

Microsoft describes this window as the classic Windows Defender Firewall, where you can create inbound or outbound rules, connection security rules, and view firewall monitoring logs.

Create the outbound rule

  1. In the left pane, select Outbound Rules.
  2. Select Action, then New rule.
  3. On the Rule Type page, select Program and select Next.
  4. On the Program page, select This program path and type or paste the full path to the program.
  5. Select Next through any Protocols and Ports or Scope page you do not need to change.
  6. On the Action page, select Block the connection and select Next.
  7. On the Profile page, choose the network types the rule applies to and select Next.
  8. On the Name page, type a name you will recognise, add a description if you like, and select Finish.

Microsoft’s rule guide notes that choosing Program or Port shortens the wizard, while Custom shows every page and gives the most control.

What each wizard page asks

Wizard pageWhat to choose for a full block
Rule TypeProgram (or Custom for every page)
ProgramThis program path, then the full path to the program
Protocols and PortsLeave as is to block the program on every port
ScopeOptional, limits the rule to traffic to or from specific IP addresses
ActionBlock the connection
ProfileThe network types the rule should apply to
NameAny name you will recognise later

Microsoft warns that if you enter a specific port or protocol, a program that uses a different one is still allowed by the default outbound behaviour.

Choose the network profiles

Windows Security shows three network types: Domain network, Private network and Public network.

Microsoft says private networks are for trusted devices such as a home network, and public networks are for untrusted places such as a coffee shop.

To keep the program offline everywhere, select all the profiles on the Profile page.

Check that the program is blocked

  1. Close the program completely and open it again.
  2. Use a feature that needs the internet, such as a sign-in, update check or online page.
  3. Expect it to fail to connect while the rule is on.

You can also confirm the rule exists by going back to Outbound Rules and looking for the name you typed, or by running Get-NetFirewallRule in PowerShell, a cmdlet Microsoft’s firewall documentation uses to list rules.

If you want to see which programs are connecting before you block anything, see our guide to active network connections with netstat.

Block a program with PowerShell instead

Microsoft’s firewall documentation shows a PowerShell command that creates an outbound block rule for a program.

Open Windows Terminal or PowerShell as administrator and use the same pattern with your own name and path:

New-NetFirewallRule -DisplayName "Block Example App" -Direction Outbound -Program "C:\Path\To\App.exe" -Action Block

Turn the rule off again

You have two choices when you want the program online again, and Microsoft describes them differently.

ChoiceWhat happensCommand or place
Disable the ruleThe rule stays on the PC in a disabled state, so you can turn it on laterDisable-NetFirewallRule, or the rule in Outbound Rules
Delete the ruleThe rule is removed permanentlyRemove-NetFirewallRule -DisplayName “Block Example App”

For a command prompt, Microsoft’s netsh reference shows deleting a rule by name in this form: netsh advfirewall firewall delete rule name="MyRule".

Use the exact name you gave the rule, because the delete command removes every rule that matches.

If the program runs as a service

Some programs run several Windows services from one file, and Microsoft’s rule guide has extra options on the Program page for that case.

Under Customize, you can apply the rule to services only, or to one chosen service.

Do not block Windows system files this way, because blocking core services can break updates and sign-in.

Block one program, not the whole firewall

Microsoft recommends against disabling the firewall and does not support stopping the Windows Defender Firewall service.

A rule for one program leaves the rest of your protection in place, which is why it is the better route.

If you need the firewall itself on or off, use our guide to turning Windows Firewall on or off.

If the program still connects

  • Check the path in the rule matches the program that is running, because an app updated into a new folder is a different path.
  • Check the rule is enabled and its Profile matches the network you are on.
  • Check the Action is Block the connection and the direction is Outbound.

If the firewall asks about a blocked app later, you can manage those pop-ups with our guide to Windows Security notifications.

Reset all firewall changes

If your rules cause trouble, Restore firewalls to default on the Firewall & network protection page resets firewall settings to how they were when you first got the PC.

Any firewall policies from an organisation are applied again afterwards.

Official sources

Leave a Reply

Your email address will not be published. Required fields are marked *