π Experience the new and improved APIVoid! Check out what's new
Build Windows Firewall rules online with this firewall rule builder. Generate batch scripts to block programs by file path, direction, profile, protocol, and rule group, making it easy to manage and remove rules later. Other useful tools include Curl Command Builder, Cron Expression Generator and Website Uptime Check.
WINDOWS FIREWALL TIPS
Find clear answers to common Windows Firewall questions, covering the generation of block rules, rule removal, and rule verification.
To use the Windows Firewall Rule Builder, start by entering one or more full executable file paths in the "Full file paths" field, placing each path on a separate line. These paths represent the applications you want to block. Next, choose the desired direction (inbound or outbound), network profile (any, public, private, or domain), and protocol (any, TCP, or UDP). You can also specify a rule group name (by default is "Auto-Generated Rules"), which is required and helps you manage or remove the generated rules later.
As you change any option, the tool automatically generates a ready-to-run batch script (.bat) in the below textarea. Each firewall rule is created with an automatically generated name in the format:
Here is an example auto-generated rule name for Notepad++ executable file:
This will make it easy to identify the rules inside Windows Firewall. Now, to apply all the firewall rules, simply copy or export this script and run it as an administrator on Windows.
With cmd.exe, run it as Administrator, then:
This blocks all outbound traffic from the specified executable on all profiles.
With PowerShell, run it as Administrator, then:
With cmd.exe, run it as Administrator, then:
This blocks outbound TCP connections to the specified remote port for the selected program.
With PowerShell, run it as Administrator, then:
With cmd.exe, run it as Administrator, then:
This blocks all inbound traffic from the specified executable on all profiles.
With PowerShell, run it as Administrator, then:
With cmd.exe, the dir parameter can have one of the following values:
With PowerShell, the Direction parameter can have one of the following values:
With cmd.exe, the profile parameter can have one of the following values:
If the profile parameter is omitted, it defaults to any.
With PowerShell, the Profile parameter can have one or more of the following values:
If the profile parameter is omitted, it defaults to Any.
With cmd.exe, the protocol parameter can have one of the following values:
If the protocol parameter is omitted, it defaults to any.
With PowerShell, the Protocol parameter can have one of the following values:
If the protocol parameter is omitted, it defaults to Any.
Windows Firewall rules are stored in the Windows Registry, under the following key:
You can paste this directly into regedit.exe and press Enter.
Each firewall rule is stored as a registry value inside the FirewallRules key.
Firewall rules are stored in a binary-encoded format, not plain text.
With cmd.exe, run it as Administrator, then:
If the rule exists, Windows will display all its details (direction, program path, action).
If not, youβll see: "No rules match the specified criteria.".
With PowerShell, run it as Administrator, then:
With cmd.exe, run it as Administrator, then:
If the rule exists, it will be removed immediately.
β οΈ If multiple rules share the same name, all matching rules will be deleted.
With PowerShell, run it as Administrator, then:
With cmd.exe, run it as Administrator, then:
The group parameter is used to assign the rule to a group.
With PowerShell, run it as Administrator, then:
The Group parameter is used to assign the rule to a group.
With cmd.exe, run it as Administrator, then:
All rules assigned to that group will be removed, without confirmation.
With PowerShell, run it as Administrator, then:
With cmd.exe, run it as Administrator, then:
This exports all Windows Firewall settings and rules to the specified .wfw file.
With PowerShell, run it as Administrator, then:
With cmd.exe, run it as Administrator, then:
β οΈ Importing a .wfw file replaces the current firewall configuration.
Always back up the existing rules before importing.
With PowerShell, run it as Administrator, then:
Create your account, pick a subscription plan, and make your first API call instantly with your API keyβsimple as that!
Get started now