How to block a program from accessing the internet in Windows 10 & 11

Blocking a program from accessing the internet improves security, protects privacy, and saves bandwidth. Windows allows all programs to connect to the internet. You can block outbound connections using Windows Defender Firewall or a PowerShell command. This guide shows how to create an outbound rule in Windows Firewall in Windows 10 and 11 to block a program from connecting to the internet.

ADVERTISEMENT

Method 1: Windows Firewall (GUI shortcut)

  1. Press the Windows + R keyboard keys.
  2. Type wf.msc.
  3. Press Enter.
  4. Click Outbound Rules in the top-left menu.
  5. Click New Rule in the top-right menu.
    Windows Defender Firewall screen showing Outbound Rules and New Rule options
  6. Make sure Program is selected.
  7. Click Next.
  8. Make sure This program path is selected.
  9. Click Browse.
  10. Select the program's .exe file (e.g., C:\Program Files\ProgramName\program.exe).
  11. Click Open.
    Selecting a program executable path in the Windows Firewall New Outbound Rule Wizard
  12. Click Next.
  13. Make sure Block the connection is selected.
    Selecting Block the connection option in Windows Firewall wizard
  14. Click Next.
  15. Make sure Domain, Private, and Public are checked.
  16. Click Next.
  17. Type a name for the rule (e.g., Block AppName).
  18. Click Finish.

All outbound connections from the selected program are now blocked.

An outbound rule is usually enough to block a program from accessing the internet.

Note: Blocking a program's internet access may affect program features such as software updates, cloud syncing, license checks, or remote data access.

Optional: Block inbound connections

To block incoming traffic as well, click Inbound Rules in the top-left menu and repeat the same steps.

Check for other executables (.exe)

If the program still accesses the internet, check its installation folder for helper executables like updater.exe or service.exe. Repeat the steps above to block all additional .exe files in that directory.

ADVERTISEMENT

Method 2: PowerShell (Quick CLI command)

  1. Right-click the Start button (Windows logo) on the taskbar and select Terminal (Admin) or PowerShell (Admin).
  2. Type (or copy and paste) the following command (replace "C:\Program Files\ProgramName\program.exe" with the full path to your program's executable):
    New-NetFirewallRule -DisplayName "Block Program Internet Access" -Direction Outbound -Program "C:\Program Files\ProgramName\program.exe" -Action Block
  3. Press Enter.
Running New-NetFirewallRule command in PowerShell to block program internet access

All outbound connections from the selected program are now blocked.

An outbound rule is usually enough to block a program from accessing the internet.

Note: Blocking a program's internet access may affect program features such as software updates, cloud syncing, license checks, or remote data access.

Why Is the program still accessing the Internet?

If the program is still connecting to the internet after creating an outbound rule, check for these common causes:

  • Other executables: Many modern programs use helper executables (e.g., updaterservice.exe or helper.exe) located in subfolders. You must also create firewall rules for these secondary .exe files.
  • Third-party antivirus/firewall: If you're using third-party security software (like Bitdefender, Norton, or Kaspersky), its firewall overrides Windows Defender Firewall. You must configure the block rule inside your antivirus firewall software.
  • Inbound traffic required: Some programs act as servers or listen for connections. Repeat the steps in Method 1 under Inbound Rules to block incoming connections as well.

How to unblock a program

To restore internet access for the program:

  1. Press the Windows + R keyboard keys.
  2. Type wf.msc.
  3. Press Enter.
  4. Click Outbound Rules in the top-left menu.
  5. Right-click the rule you created and select Disable Rule (to temporarily allow access) or Delete (to remove the block permanently).
ADVERTISEMENT

Related:

How to block a website in Windows 10 and 11 (step by step)


Windows


References:

https://learn.microsoft.com/en-us/windows/security/operating-system-security/network-security/windows-firewall/rules