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

How to Block a Program in Firewall

nishantBy nishantNovember 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

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

packet loss test

How To Perform Packet Loss Test On Windows

January 15, 2023
how to reset ethernet adapter

How To Reset Ethernet Adapter

January 2, 2023
does my pc have wifi

Does Your Desktop Have Wi-Fi? Here’s How to Find Out

January 1, 2023
dns server is not responding

8 Ways to Fix “DNS Server Is Not Responding” Error

December 27, 2022
how-to-reset-spectrum-wifi

How to Reset Spectrum Wi-Fi

December 26, 2022
how to update router firmware tp-link

How to Update Router Firmware on TP-Link (2 Possible Ways)

December 26, 2022
Add A Comment

Leave A Reply Cancel Reply

Latest Posts
how long does a cmos battery last

How Long Does a CMOS Battery Last

January 25, 2023
thunderbolt vs usb c

Thunderbolt Vs USB C: What’s the Difference

January 25, 2023
how to find hidden folder in laptop

How to Find Hidden Folder in Laptop

January 24, 2023
You may also like
watch-twitch-on-roku-tv

How to Watch Twitch on Roku TV

January 25, 2023
hp mouse not working

HP Mouse Not Working? Here’s How to Fix It

January 25, 2023
install-kodi-on-firestick

How to Install Kodi on Firestick (Step-By-Step Guide)

January 25, 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.

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