- Open the Run window (Windows key + R).
- Type "WF.msc". This should open up Windows Defender Firewall with Advanced Security.
- Click on Outbound Rules in the left sidebar.
- Select New Rule in the right sidebar.
- Check if Program selected, click on Next.
- Browse and locate your executable. (.exe).
- Select Block the connection. Click Next.
- Let the checkboxes remain as is if you want to block the connection everywhere regardless of the network it is connected to. Click Next.
- Write an appropriate Name and Description so you know which program is being blocked by the rule. (Will save confusion later when trying to unblock the program.)
- Click on Finish.
If you wish to unblock the connection, simply select and delete (R-Click + Delete, or Del on the keyboard) the rule.
This is the general solution to block connections of the program to the internet (and other computers on the network). If you want to block incoming connections to the program, create a similar rule in the Inbound rules section (Left sidebar).