Tech News Today
  • Hardware
    • Motherboards
    • CPUs
    • Graphic Cards
    • RAM
    • SSDs
    • Computer Cases
    • Monitors
    • Peripherals
    • Power Supply Unit
    • PC Builds
    • Computer Tips
  • Software
  • Operating System
    • Windows
    • Mac
    • Linux
  • Gaming
  • Mobile
  • Console
  • More
    • Internet
    • Networking
    • Security
    • Buyer’s Guide
    • Gadgets
    • Laptops
    • Reviews
    • How To
    • News
Facebook Twitter Instagram
Tech News Today
  • Hardware
    • Motherboards
    • CPUs
    • Graphic Cards
    • RAM
    • SSDs
    • Computer Cases
    • Monitors
    • Peripherals
    • Power Supply Unit
    • PC Builds
    • Computer Tips
  • Software
  • Operating System
    • Windows
    • Mac
    • Linux
  • Gaming
  • Mobile
  • Console
  • More
    • Internet
    • Networking
    • Security
    • Buyer’s Guide
    • Gadgets
    • Laptops
    • Reviews
    • How To
    • News
Tech News Today
Home » Networking

How to Block a Program in Firewall

Nishant AryalBy Nishant AryalNovember 1, 2022
How to Block a Program in Firewall

A Firewall is a crucial security layer that monitors the network traffic and secures it from unsolicited threats and attacks. Users can manually configure the firewall to prevent a program from using network traffic to strengthen network security.

The most prominent way to block a program in a firewall is by setting inbound and outbound rules. Windows defender, a built-in host-based firewall, manages all these configurations on Windows. It also provides the option to choose the program you want to restrict communicating with the firewall. 

Today’s article discusses how you can block a program in a firewall using various graphical and CLI utilities.

Table of Contents

  • Ways to Block a Program in Firewall 
    • Block Programs on Public and Private Networks
    • Block Incoming Programs on Firewall
    • Create a Firewall Rule
    • Using Command Prompt
    • Using Powershell 

Ways to Block a Program in Firewall 

On Windows, there are graphical as well as command-line-based options for blocking a program in Firewall. Generally, the firewall can be manually configured from the Windows Defender settings. However, these configuration changes can also be done using the command lines from the Command prompt and PowerShell. 

Block Programs on Public and Private Networks

From the firewall settings of Windows, you can restrict communication of a program through the Firewall. Furthermore, you can even assign a network (public or private) that can be used by the application. 

  1. Press Windows Key + R to launch Run.
  2. Type firewall.cpl and hit enter.
  3. On the left panel of the windows Firewall Window, Click on  Allow an app or feature through Windows Firewall.Allow an app or feature
  4. Click on the Change Settings button.Change settings of firewall
  5. Uncheck the programs you want to restrict communicating through the firewall. 
  6. Click on OK to save the changes. Block program on firewall

Block Incoming Programs on Firewall

Users can also block the incoming connections for all the programs listed on the Allowed apps.  This is done to enhance the security of the connection. After performing this, you will remain connected to the internet, but it will restrict receiving any incoming traffic for different apps. 

  1. Press Windows Key + R to launch Run.
  2. Type firewall.cpl and hit enter.
  3. Click on Change notification settings from the left panel. Change notification settings of firewall
  4. Click on Block all incoming connections,  including those in the list of allowed apps. Do this in both the Public and Private network settings section.  
  5. Finally, click on OK to save the firewall configurations. Block private and public network for a program

Create a Firewall Rule

On Windows, you can add two control mechanisms to the firewall; the inbound and outbound rules. Inbound rules can be used to block internet traffic from unknown sources and restrict malicious programs from getting access to the network. Similarly, the outbound rules can be used to restrict selected programs from using the traffic exiting the firewall. 

  1. Press Windows Key + R, type firewall.cpl, and hit enter.
  2. From the Left section of the Windows Defender Firewall window, go to Advanced settings.Advanced settings of firewALL
  3. Click on Inbound Rules. 
  4. From the Actions panel, click on the New Rule button.Set new inbound rule
  5. Choose the Program option in the Rule type step and click on Next.Select program options
  6. You will now be asked to choose the file path for the application you want to block. Click on Browse and select the path to the application’s executable file.
     File path of the program
  7. Click on Next.
  8. Choose the Block the connection option and click on Next. Block the connection option
  9. Select the Network type ( Domain, Private or Public ) you want to apply the inbound rule.
    choose network profile
  10. Give an appropriate name for the rule so you can find it easily next time you want to modify or delete it.
  11. Finally, click on Finish.give approproate name for the rule
  12. Now, go to the Outbound Rules and set the firewall rules following the same steps you performed earlier. 

Using Command Prompt

On the Command prompt, you can use the netsh command line that can be used to configure the network settings. It is also possible to run the netsh from a batch file to modify your network configurations. Here’s how you can use this utility to block a program in the firewall.

  1. Press Windows Key + X and open Terminal (Admin).
  2. Now, execute this command line to block the desired program. Just replace everything inside the quotations with the name and file directory of the preferred program you want to add to the block list. We have used chrome in this command for your reference. 
    netsh advfirewall firewall add rule name="Chrome" dir=in action=block program="C:/Program Files/Google Chrome/Chrome.exe" enable=yesset filrewall rule from CMD

This command will set an inbound rule and block the chrome browser and restrict it from using the traffic received by the computer. 

Using Powershell 

PowerShell has a similar command-line utility to the netsh, which can be used to block a program in the firewall. 

  1. Press Windows Key + R, type powershell, and hit enter. 
  2. Execute this command in PowerShell. Replace the name of the program and its file path with your preferred one. We have used the Chrome browser in this command for your reference. 
     New-NetFirewallRule -DisplayName "Chrome" -Direction Outbound -Program "C:/Program Files/Google Chrome/Chrome.exe" -Action Blocknew-firewallrule command

Executing this command will add an outbound rule to the firewall for all network profiles (Domain, Private and Public) and prevent the chrome browser from accessing the internet. 

how-to
Nishant Aryal
  • LinkedIn

Nishant is an enthusiast who loves writing about technology. He also is heavily invested in keeping himself updated about the latest happenings in the tech world. At Tech News Today, he covers Operating Systems, how-to-topics, and Fixes.

Related Posts

intel wireless ac 9560 not working

Intel Wireless AC 9560 Not Working? Try these Fixes

September 16, 2023
does your ip address change when you move

Does Your IP Address Change When You Move?

July 16, 2023
locate wifi access point

How to Locate a Wi-Fi Access Point

July 6, 2023
lease time dhcp

What is DHCP Lease time? Can You Change It?

July 2, 2023
Failed to obtain IP address 1

5 Ways to Fix “Failed to Obtain IP Address”

June 30, 2023
How to Forget a Network

How to Forget a Network on Windows

June 27, 2023
Add A Comment

Leave A Reply Cancel Reply

Latest Posts
how to turn off hardware acceleration

How to Turn Off Hardware Acceleration

September 22, 2023
motherboard chipset

Understanding Motherboard Chipset and Its Importance

September 20, 2023
Naval-Warfare-Games

Best Naval Warfare Games

September 18, 2023
You may also like
printer-not-printing

How to Fix a Printer That’s Not Printing

September 20, 2023
Share Location With Friends and Family

Share Location With Friends and Family (iPhone and Android)

September 18, 2023
how-to-print-without-a-printer

How to Print Without a Printer

September 18, 2023
Recommended
Cookie Clicker Garden Guide

Cookie Clicker Garden Guide to Unlocking Every Seed

September 26, 2021
monitor no signal

Computer Turns On But Monitor Says No Signal (9 Ways To Fix)

November 10, 2022
Facebook Twitter Pinterest
  • Home
  • About Us
  • Our Team
  • Editorial Guidelines
  • Privacy Policy
  • Affiliate Disclosure
© 2023 TechNewsToday, editor@technewstoday.com | Tech Central Pvt. Ltd.

Type above and press Enter to search. Press Esc to cancel.