Block an App From Accessing the Internet (Firewall Rule)

Create an outbound Windows Firewall rule that cuts a program off from the network.

WindowssecuritypowershellfirewallMedium risk
Run New-NetFirewallRule -DisplayName "Block App" -Direction Outbound -Program "C:\path\app.exe" -Action Block in an admin PowerShell.

01Command

Command
$ New-NetFirewallRule -DisplayName "Block TelemetryApp" -Direction Outbound -Program "C:\Program Files\TelemetryApp\app.exe" -Action Block

02What it does

Windows Firewall passes outbound traffic by default, so most apps call home freely. An outbound rule with Action Block and the program's full .exe path stops that app from opening any internet connection. Delete the rule with Remove-NetFirewallRule when you want to allow it again.

03Risk

RiskMedium risk
RequirementsRun PowerShell as administrator. Use the full .exe path of the program you want to block.
!Warning: If the app is updated or moved, its path changes and the block stops working — verify the exact .exe path, and don't block system services like svchost.exe.

04Undo

Undo
$ Remove-NetFirewallRule -DisplayName "Block TelemetryApp"

05Sources

  • New-NetFirewallRule
    Microsoft Learn · vendor-doc · 2026-09-17
    Evidence: Documents creating a firewall rule with Direction, Program and Action parameters, including outbound blocking.

Last verified: 2026-09-18 · Category: Security & Privacy

06Related solutions