👨‍🏫 Tutorial Blocking Connection of EXE`s in a Folder.

degald545

Honorary Poster

Are you tired of manually adding all exe`s and configuring to your needs?​

Let me introduce to youYou do not have permission to view the full content of this post. Log in or register now. by You do not have permission to view the full content of this post. Log in or register now.

1718502361317.png1718502385193.png

A script that lets you add all EXE`s from a folder to the firewall and block connections both Inbound and Outbound.
Keep in mind that this uses command line (CMD or Powershell) to execute with it`s functions through parameters. But don`t worry, there are examples and within the script so you only need to copy the folder path you wanna add.


Steps:
1. Download and get the latest Script.
1718503424147.png1718503486099.png

2. Head to the Location of the Script and Hold Shift and Right-Click and select Open Powershell. (Always run at Administrator Privileges)
TUT.png


3. Copy the Folder Path of the EXE`s you wanna add to firewall and set your parameters.
1718503944895.png1718504221632.png

Syntax:

.\BlockFolderWindowsFirewall -Path "Folder Path" -Parameter -Parameter

Parameters:

Parameter​
Description​
-PathThe folder of EXEs to block/unblock.
-RecurseScans the folder and subfolders for EXEs.
-UnblockInsteadUnblocks the EXEs in a folder or subfolder.
-InboundBlocks all inbound connections for the EXEs in a folder or subfolder.
-OutboundBlocks all outbound connections for the EXEs in a folder or subfolder.
-CheckForUpdateChecks if there is an update available for the script.
-UpdateSelfUpdates the script to the latest version.
-HelpDisplays the help message.
-VersionShows the current version of the script.

Examples:

Description​
Command​
Block all EXEs in a specified folder.\BlockFolderWindowsFirewall -Path "Folder Path"
Block all EXEs in a specified folder and its subfolders.\BlockFolderWindowsFirewall -Path "C:\Folder\Subfolder" -Recurse
Block only the inbound connections for EXEs in a specified folder.\BlockFolderWindowsFirewall -Path "C:\Folder\Subfolder" -Inbound
Block only the outbound connections for EXEs in a specified folder.\BlockFolderWindowsFirewall -Path "C:\Folder\Subfolder" -Outbound
Unblock all EXEs in a specified folder.\BlockFolderWindowsFirewall -Path "C:\Folder\Subfolder" -UnblockInstead
Unblock all EXEs in a specified folder and its subfolders.\BlockFolderWindowsFirewall -Path "C:\Folder\Subfolder" -Recurse -UnblockInstead
Unblock only the inbound connections for EXEs in a specified folder.\BlockFolderWindowsFirewall -Path "C:\Folder\Subfolder" -UnblockInstead -Inbound
Unblock only the outbound connections for EXEs in a specified folder.\BlockFolderWindowsFirewall -Path "C:\Folder\Subfolder" -UnblockInstead -Outbound
Display help for the script.\BlockFolderWindowsFirewall -Help
Check the current version of the script.\BlockFolderWindowsFirewall -Version
Check if there is an update available for the script.\BlockFolderWindowsFirewall -CheckForUpdate

Errors

If ever you encounter this error,
1718507947880.png

Do this First.

Set-ExecutionPolicy RemoteSigned -Scope Process -Force
This will only Remove the Execution Policy on the Current Command Line and will set back to Default after you exit. Refer to this You do not have permission to view the full content of this post. Log in or register now. for more info.

Output:

1718507586130.png
1718507732343.png
1718507755983.png
1718507547540.png
 

About this Thread

  • 1
    Replies
  • 401
    Views
  • 2
    Participants
Last reply from:
Master18

Online now

Members online
372
Guests online
3,583
Total visitors
3,955

Forum statistics

Threads
2,290,563
Posts
29,065,116
Members
1,212,384
Latest member
BuyetBatongbakal
Back
Top