How to block a program from accessing the internet on Windows

Learn how to block a program from accessing the internet on Windows 10 and 11 with Windows Firewall.


1. Click on the Windows Security icon located in the system tray to open Windows Security.

Windows Security system tray icon

2. Click on Firewall & network protection.

Windows Security Firewall and network protection

3. Click on Advanced settings located at the bottom.

Advanced Firewall settings

This will open “Windows Defender Firewall with Advanced Security”.

You can also click on the Windows start menu button > type firewall > click on Windows Defender Firewall with Advanced Security when it appears in the search results.

4. When the “User Account Control” window appears, you click Yes. Depending on your settings, you may also need to enter the admin password and click Yes.

5. In the “Windows Defender Firewall with Advanced Security” window, you click on Outbound Rules located in the top left corner.

Windows Firewall outbound rules

6. Click on New Rule located in the top right corner.

Windows Firewall New Rule

A “New Outbound Rule Wizard” window will appear.

7. Check the Program option.

Windows Firewall new outbound rule program option

8. Click on the Next button in the bottom right corner of the window.

9. Make sure the This program path option is checked.

10. You can enter the full path of the program (e.g., C:\Program Files\Mozilla Firefox\firefox.exe) or you can click on the Browse button to browse for the program.

Windows Firewall program path

If you clicked on the Browse button, a small window appears. And within this small window, you will have to navigate to the program you want to block from accessing the internet.

Usually, you can find a program in the Program Files or Program Files (x86) folder on the (C:) drive. Like for example: C:\Program Files\Mozilla Firefox\firefox.exe.

One thing to keep in mind is that, for most programs, the main EXE file is the file you want to block. But there are programs for which you have to block another EXE file. You can also block multiple EXE files from the program's folder. Just to be sure.

11. Click on the Next button at the bottom of the window.

12. Make sure the Block the connection option is checked.

Windows Firewall Block the connection option

13. Click on the Next button.

14. Make sure the Domain, Private, and Public options are checked.

Windows Firewall Domain Private and Public options

15. Click on the Next button.

16. In the name field, you type a name for the rule (e.g., Block Firefox).

Windows Firewall rule name

17. Click on the Finish button.

Now all outbound connections from the program in question are blocked.

If you want to completely block the program from accessing the internet, you click on Inbound Rules in the top left corner and repeat the process you used to create the outbound rule, step for step.

Windows Firewall inbound rules

If the program is still connecting to the internet, you may need to create one or more rules for other EXE files from the program's folder, or you may need to edit the program's path in the rule you created. To do so, you double-click on the newly created outbound rule > Click the Programs and Services tab > In the This program field, you enter the full path of the program. Like for example, %ProgramFiles%\Mozilla Firefox\firefox.exe becomes C:\Program Files\Mozilla Firefox\firefox.exe > Click on the Apply button > Click on the OK button.