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:
Explicit allow rules take precedence over the default block setting.
Explicit block rules take precedence over any conflicting allow rules.
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.
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.
Select Outbound Rules in the left-hand pane.
Select Action > New Rule (or New Rule... in the Actions pane on the right).
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.
Enter the program path. Select This program path, paste in the full path to the .exe (or use Browse), then select Next.
Choose the action. Select Block the connection, then Next.
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.
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.