To block one app's network access on Windows 11 or Windows 10, open wf.msc, create an outbound rule for the app's .exe path and set its action to Block the connection.
This guide covers the console wizard, matching inbound rules, PowerShell and netsh commands, per-network profiles, how to test the block and how to remove it again.

Block specific apps’ network access with Windows Defender Firewall (Advanced Security) on Windows 10/11
Windows Defender Firewall allows all outbound traffic by default, so an app keeps its internet access until an outbound block rule matches it.
You need administrator rights on the PC for every step in this guide.
- Select Start, type
wf.mscand press Enter to open Windows Defender Firewall with Advanced Security. - Select Outbound Rules in the left pane, then select Action > New rule.
- On the Rule Type page, select Custom, then select Next.
- On the Program page, select This program path, type or browse to the app's full .exe path, then select Next.
- On the Protocol and Ports page, leave the protocol set to any so every port is covered, then select Next.
- On the Scope page, leave the addresses set to any, then select Next.
- On the Action page, select Block the connection, then select Next.
- On the Profile page, keep Domain, Private and Public checked, then select Next.
- On the Name page, type a clear name such as "Block AppName outbound" and select Finish.
The rule takes effect as soon as you select Finish, and the app cannot send traffic on any port while it is enabled.
You can also reach the same console from Windows Security: select Firewall & network protection, then Advanced settings.
Inbound vs outbound firewall rules for a single app
The direction of the rule decides what the app loses, so match the rule to what you want to stop.
| Rule | What it stops | When to use it |
|---|---|---|
| Outbound block rule | The app sending any traffic out, including internet access, update checks and telemetry | Cut an app off from the internet |
| Inbound block rule | Other devices connecting to the app when it listens on a port | Stop a game server, sharing tool or remote tool accepting connections |
| Both rules | All traffic the app starts and all unsolicited traffic it would receive | Isolate the app completely |
| Allowed apps list in Windows Security | Only controls inbound exceptions; it is not a blocking tool | Let a trusted app receive connections |
Inbound traffic is already blocked by default unless an allow rule exists, so the outbound rule is the one that removes internet access for most desktop apps.
How to block an app from receiving inbound connections in Windows Firewall
Create an inbound block rule when an installer or an earlier prompt added an allow rule for the app.
- Open
wf.mscand select Inbound Rules in the left pane. - Select Action > New rule, choose Custom on the Rule Type page and select Next.
- On the Program page, select This program path, enter the app's full .exe path and select Next.
- Select Next on the Protocol and Ports and Scope pages to cover all ports and addresses.
- On the Action page, select Block the connection, then select Next.
- Choose the profiles on the Profile page, name the rule and select Finish.
An explicit block rule wins over any conflicting allow rule, so an existing allow entry for the same app no longer lets traffic through.
Block a program from the internet with PowerShell New-NetFirewallRule
PowerShell creates the same outbound rule in one line, which is useful when you block several apps or repeat the job on other PCs.
Open Windows PowerShell or Terminal as administrator, then run the command with your app's path in place of the example.
New-NetFirewallRule -DisplayName "Block AppName outbound" -Direction Outbound -Program "C:\Program Files\AppName\app.exe" -Action Block
-DisplayName is the name shown in the console, -Direction Outbound targets traffic the app sends, -Program is the full path to the executable and -Action Block drops matching traffic. Add -Profile Public to limit the rule to public networks; the default is Any.
You should see: PowerShell prints the new rule's properties, including Enabled : True, Direction : Outbound and Action : Block.
Run the command again with -Direction Inbound and a different -DisplayName to add the matching inbound rule.
Block an app with netsh advfirewall firewall add rule
Command Prompt users can create the rule with netsh, which works on every supported Windows 10 and Windows 11 build.
Open Command Prompt as administrator before you run it.
netsh advfirewall firewall add rule name="Block AppName outbound" dir=out program="C:\Program Files\AppName\app.exe" action=block
name= sets the rule name, dir=out makes it an outbound rule, program= is the full executable path and action=block drops the app's traffic. Use dir=in for the inbound version.
You should see: netsh replies Ok. and the rule appears under Outbound Rules in wf.msc.
Microsoft notes that you cannot add rules to a custom rule group with netsh, so use PowerShell if you want to manage several block rules as one group.
How to block an app only on public Wi-Fi in Windows Firewall
Windows applies one network profile at a time: Domain for a workplace network, Private for a trusted home network and Public for untrusted networks such as cafe Wi-Fi.
A rule limited to the Public profile blocks the app on hotspots but leaves it working at home.
- Open
wf.mscand select Outbound Rules. - Double-click the block rule you created to open its properties.
- Select the Advanced tab.
- Under Profiles, clear Domain and Private and keep Public checked.
- Select OK to save the rule.
In PowerShell, the same result comes from adding -Profile Public when you create the rule.
Check which profile your current network uses in Windows Security > Firewall & network protection, which marks the active network.

How to tell if Windows Firewall is blocking an app
Three checks show whether the rule exists, is active and is dropping the app's packets.
- Open the app and try something that needs the network, such as signing in or checking for updates; it should fail or report no connection.
- In
wf.msc, expand Monitoring and select Firewall to see the rules that are currently active; a disabled rule does not appear there. - In an elevated PowerShell window, run
Get-NetFirewallApplicationFilter -Program "*app.exe*" | Get-NetFirewallRuleto list every rule tied to that executable. - To log the drops, select Windows Defender Firewall with Advanced Security in the console tree and select Properties in the Actions pane.
- Open the tab for your active profile, select Customize under logging, set Log dropped packets to Yes and select OK.
- Reproduce the connection attempt, then open the log file, by default
%SystemRoot%\System32\LogFiles\Firewall\pfirewall.log, and look for DROP lines.
Turn dropped-packet logging off again when you finish, because the log keeps growing up to its size limit.

How to unblock an app in Windows Defender Firewall
Disabling keeps the rule for later, while deleting removes it permanently.
- Open
wf.mscand select Outbound Rules or Inbound Rules. - Right-click the block rule by name.
- Select Disable Rule to pause the block, or Delete to remove it.
- From PowerShell, run
Disable-NetFirewallRule -DisplayName "Block AppName outbound"to disable, orRemove-NetFirewallRule -DisplayName "Block AppName outbound"to delete. - From Command Prompt, run
netsh advfirewall firewall delete rule name="Block AppName outbound"to delete it.
A disabled rule comes back with Enable-NetFirewallRule -DisplayName "Block AppName outbound". Avoid Remove-NetFirewallRule -Action Block unless you mean it, because it deletes every block rule on the PC.
Windows Firewall block rule not working for an app
Most failed blocks come down to the wrong executable, the wrong profile or a rule that is not active.
The app still connects to the internet after you add the rule
The traffic comes from a different executable, such as an updater, helper or service process.
- Check the app's install folder for other .exe files that run in the background.
- Create an outbound block rule for each executable that makes connections.
- Use the full path in every rule; wildcard paths such as
C:\*\app.exeare not supported in application rules.
The rule exists but does not show under Monitoring
The rule is disabled or assigned to a profile that is not active on the current network.
- Open the rule's properties and make sure Enabled is checked on the General tab.
- On the Advanced tab, check the profile that matches your current network.
- Make sure the firewall itself is on for that profile in Windows Security > Firewall & network protection.
Your block rules disappeared
Restore firewalls to default resets Windows Defender Firewall to its original rules and removes custom ones.
- Recreate the rule with the PowerShell command in this guide.
- Keep the commands in a text file so you can run them again after any future reset.
You cannot create or change firewall rules
You are not an administrator, or your organization manages the firewall through policy.
- Sign in with an administrator account, or run PowerShell and Command Prompt as administrator.
- On a work or school PC, ask your IT administrator; policies can stop local rules from applying.
A Microsoft Store app ignores a program path rule
Store apps are identified by their package, not just an .exe path.
- Create the rule in PowerShell with the -Package parameter, which takes the app package's security identifier (SID).
- Check under Monitoring > Firewall that the new rule is listed as active.
If the whole firewall is not enforcing rules, Microsoft's own fix is to turn it back on for all profiles with Set-NetFirewallProfile -Profile Domain,Public,Private -Enabled True.

Block app internet access in Windows Firewall FAQ
How do I block a program from accessing the internet in Windows 11?
Open wf.msc, select Outbound Rules > New rule, choose Custom, enter the program's full path, select Block the connection, keep all profiles and finish. The rule applies immediately and stops the program sending traffic on any port.
Does blocking an app in Windows Firewall work the same on Windows 10?
Yes. Windows Defender Firewall with Advanced Security, wf.msc, New-NetFirewallRule and netsh advfirewall all work the same way on Windows 10 and Windows 11, and Microsoft documents them for both.
Do I need an inbound and an outbound rule to block an app?
An outbound rule alone removes internet access, because it stops the app sending traffic. Add an inbound block rule as well if the app listens for connections and already has an allow rule from its installer.
Does a block rule override the allowed apps list?
Yes. Explicit block rules take precedence over conflicting allow rules, so an app on the allowed apps list is still blocked while your block rule is enabled.
Can I use a wildcard path in a firewall app rule?
No. Windows Firewall does not support wildcard patterns such as C:\*\teams.exe in application rules. Each rule needs the full path to the executable, and environment variables such as %ProgramFiles% are allowed.
How do I find which firewall rules apply to an app?
Run Get-NetFirewallApplicationFilter -Program "*app.exe*" | Get-NetFirewallRule in an elevated PowerShell window. It lists every rule linked to that executable, including its direction, action and whether it is enabled.
Will blocking an app stop it from updating?
Yes, if the app updates itself through the blocked executable. Apps that use a separate updater or service process keep updating until you also block that executable.
Should I turn off Windows Firewall instead of blocking one app?
No. Turning the firewall off removes protection for every app and network, while a single block rule affects only the app you choose and leaves your other Windows Security protection settings untouched. Microsoft also warns against stopping the Windows Defender Firewall service.





