Skip to content

How-ToOS

How to Block an App from the Internet with Windows Firewall in Windows 11

How to stop a specific app going online in Windows 11 with an outbound Windows Firewall rule, using Windows Defender Firewall with Advanced Security or a single New-NetFirewallRule PowerShell command, plus how rule precedence works, how to check it and how to remove the rule.

By , Systems & Technical Editor

6 min read

How to Block an App from the Internet with Windows Firewall in Windows 11

It's based on Microsoft's Windows Firewall documentation on Microsoft Learn, Microsoft's PowerShell reference for the NetSecurity module and Microsoft Support's Windows Security pages, all read on 24 November 2026. Menu wording can change between Windows updates.

There are plenty of reasons to stop a program going online. You might want to keep a single-player game offline, stop an old app from checking for an update that breaks it, or make sure a tool you've downloaded can't send data anywhere. You don't need third-party software to do this. The firewall built into Windows 11 can block one specific app while everything else carries on as normal.

The trick is knowing which kind of rule to make. The familiar Allow an app through firewall list won't do it. You need an outbound rule.

Why the "allowed apps" list isn't enough

Microsoft's documentation explains two default behaviours that matter here:

  • Inbound traffic is blocked by default. Windows Firewall has a default block action for incoming connections, which is why apps that need to accept connections (game servers, remote desktop tools, media servers) need allow rules. The Allow an app through firewall list in Windows Security is about creating those exceptions.

  • Outbound traffic is allowed by default. In Microsoft's words, "By default, Windows Firewall allows all outbound network traffic, unless it matches a rule that prohibits the traffic."

So an app that connects out to the internet, which is what almost every app does, is allowed unless you add a rule saying otherwise. That's what an outbound block rule is.

Microsoft also sets out how conflicting rules are resolved, which is useful to know:

  1. Explicit allow rules take precedence over the default block setting.

  2. Explicit block rules take precedence over any conflicting allow rules.

  3. More specific rules take precedence over less specific ones, except where an explicit block rule applies.

Microsoft says outbound rules follow the same precedence. That means a block rule you create wins, even if the app's installer added its own allow rule.

Before you start

  • You need an administrator account. Microsoft says changing Windows Firewall configuration requires administrative rights.

  • Find the app's full path. Microsoft notes that wildcard patterns (such as C:\*\teams.exe) aren't supported in application rules. You have to use the full path to the program. The easiest way to find it is to right-click the app's shortcut and choose Open file location, or find the running process in Task Manager, right-click it and choose Open file location. Then copy the path from File Explorer's address bar and add the .exe name.

  • Check whether it uses more than one program. Some apps, especially game launchers, run a separate updater or helper process. A rule only applies to the executable you name, so you may need a rule for each one. If an app still connects after you've blocked it, look in Task Manager for other processes it's running.

Method 1: Windows Defender Firewall with Advanced Security

This is the graphical way, and it lets you see and manage the rule later.

  1. Open the console. Press Start, type wf.msc and press Enter. Microsoft lists this as the way to open Windows Defender Firewall with Advanced Security on a single device. You can also get there from Windows Security > Firewall & network protection > Advanced settings.

  2. Select Outbound Rules in the left-hand pane.

  3. Select Action > New Rule (or New Rule... in the Actions pane on the right).

  4. Choose the rule type. Select Program and then Next for the simplest route. Microsoft's own procedures use Custom, which shows every page of the wizard, but Program is enough for blocking a single app.

  5. Enter the program path. Select This program path, paste in the full path to the .exe (or use Browse), then select Next.

  6. Choose the action. Select Block the connection, then Next.

  7. Choose the profiles. Leave Domain, Private and Public all ticked if you want the app blocked on every network. Microsoft describes these as workplace, trusted and untrusted networks. You could untick Private if you only want an app blocked on public Wi-Fi.

  8. Name it. Give the rule a clear name such as "Block - GameName", add a description if you like, then select Finish.

The rule takes effect straight away. You'll find it in the Outbound Rules list, where you can right-click it to Disable Rule, Delete it, or open Properties to change the path or profiles.

Blocking incoming connections too

An outbound rule stops the app connecting out, which covers most cases. If you also want to make sure nothing can connect in to the app, repeat the same steps under Inbound Rules. Microsoft's inbound program rule procedure uses the same This program path page and the same action, profile and name pages.

Method 2: One PowerShell command

If you're comfortable with the command line, Microsoft's NetSecurity PowerShell module can create the same rule in one line. Open Terminal (Admin) or PowerShell as administrator and run:

New-NetFirewallRule -DisplayName "Block - MyApp" -Direction Outbound -Program "C:\Program Files\MyApp\MyApp.exe" -Action Block

Replace the path with your app's. Here's what each part does, according to Microsoft's reference for New-NetFirewallRule:

Parameter

What it does

-DisplayName

The name shown in the firewall console

-Direction

Inbound or Outbound. The default is Inbound, so you must set Outbound

-Program

The full path and file name of the program

-Action

Allow or Block. The default is Allow, so you must set Block

The two defaults are the easy mistake to make. Leave out -Direction Outbound and you'll create an inbound rule. Leave out -Action Block and you'll create an allow rule. The cmdlet also has a -Profile parameter if you want to limit the rule to certain network types, and a -Package parameter for Microsoft Store apps, which Microsoft says takes the app's security identifier (SID) rather than a file path.

To remove the rule later, Microsoft's Remove-NetFirewallRule reference shows deleting a rule by its display name:

Remove-NetFirewallRule -DisplayName "Block - MyApp"

Be careful to include -DisplayName. Microsoft's own first example shows that running Remove-NetFirewallRule with no parameters removes all static local firewall rules.

Microsoft notes that the Network Command Shell (netsh) can also configure Windows Firewall, but the PowerShell cmdlets are easier to read. If you're new to the command line, our guide to using Windows Terminal covers opening an admin session.

How to check it's working

With the rule enabled, open the app and try something that needs the internet, such as signing in or checking for updates. It should fail or report that it's offline. If it still connects, check that:

  • The path in the rule exactly matches the running executable (check in Task Manager).

  • The app isn't using a second helper or updater process that also needs a rule.

  • The rule is enabled and covers the network profile you're using.

What not to do

Don't switch the firewall off to fix a connection problem with a different app. Microsoft's Windows Security guidance says turning off Windows Firewall could make your device more vulnerable to unauthorised access, and recommends allowing a blocked app through the firewall instead. Similarly, Microsoft calls opening ports riskier than adding an app to the allowed list, because "a port stays open until you close it, but an allowed app opens the required ports only when needed".

If your whole PC is having network trouble rather than one app, a firewall rule probably isn't the cause. Our guides to resetting network settings and changing DNS in Windows 11 are better starting points.

Our verdict

To stop one app going online in Windows 11, create an outbound block rule for its .exe, because Windows Firewall allows outbound traffic by default and the allowed apps list doesn't change that. The graphical route is wf.msc > Outbound Rules > New Rule > Program > Block the connection. The quick route is a single New-NetFirewallRule command with -Direction Outbound and -Action Block. Explicit block rules beat allow rules, so your rule will win, but you'll need the full path and may need extra rules for launchers that run several processes. Name your rules clearly so you can find and remove them later.

The bottom line

To stop one app going online in Windows 11, create an outbound block rule for its .exe, because Windows Firewall allows outbound traffic by default and the allowed apps list doesn't change that. The graphical route is `wf.msc` > Outbound Rules > New Rule > Program > Block the connection. The quick route is a single `New-NetFirewallRule` command with `-Direction Outbound` and `-Action Block`. Explicit block rules beat allow rules, so your rule will win, but you'll need the full path and may need extra rules for launchers that run several processes. Name your rules clearly so you can find and remove them later.

Sources

  1. 01Microsoft Learn: Windows Firewall rules
  2. 02Microsoft Learn: Configure Windows Firewall rules with group policy
  3. 03Microsoft Learn: Windows Firewall tools
  4. 04Microsoft Learn: New-NetFirewallRule (NetSecurity)
  5. 05Microsoft Learn: Remove-NetFirewallRule (NetSecurity)
  6. 06Microsoft Support: Firewall and network protection in the Windows Security app
  7. 07Microsoft Support: Risks of allowing apps through Windows Defender Firewall

About the author

Marcus Thorne

Systems & Technical Editor

Marcus writes Forge PC's step-by-step build, troubleshooting and system optimisation guides. His background spans Windows kernel and power-state diagnostics, UEFI/BIOS configuration, NVMe storage arrays, ATX 3.1 power delivery and running local AI and LLM workloads on consumer graphics cards.

More from Marcus Thorne

Read next

How to Set Up a UPS to Shut Down Your PC Automatically

How-To

How to Set Up a UPS to Shut Down Your PC Automatically

How to make a UPS shut your PC down automatically in a power cut: connect the UPS's USB data cable, install the maker's software (CyberPower PowerPanel Personal as the example), choose Keep Computer Running or Preserve Battery Power, pick shutdown or hibernation, then test it.

Marcus Thorne7 min

Clonezilla vs Rescuezilla: Which Free Disk Imaging Tool Should You Use?

Versus

Clonezilla vs Rescuezilla: Which Free Disk Imaging Tool Should You Use?

Clonezilla vs Rescuezilla: both are free bootable disk imaging and cloning tools that share an image format. Clonezilla adds network destinations, encryption, scripting and mass deployment; Rescuezilla offers a point-and-click desktop, image browsing and extra rescue tools.

Callum Reid6 min

ShareX vs Snipping Tool: Which Free Screenshot Tool Should You Use?

Versus

ShareX vs Snipping Tool: Which Free Screenshot Tool Should You Use?

ShareX vs Snipping Tool: Windows' built-in Snipping Tool is quick and now does local OCR and video snips, while free, open-source ShareX adds scrolling captures, richer annotation, automated after-capture tasks, uploads and many extra tools. Here's which suits you.

Callum Reid7 min

How to Set Up SillyTavern with a Local LLM Using KoboldCpp

How-To

How to Set Up SillyTavern with a Local LLM Using KoboldCpp

How to set up SillyTavern with a local LLM: installing it on Windows or Linux, loading a GGUF model in KoboldCpp, connecting the two, tuning GPU layers to fit your graphics card's VRAM, adjusting context settings and fixing common problems.

Marcus Thorne8 min