At first, why we have to block a program with a firewall from access the Internet? There are several reason to do that:
Let's start. Open the Windows 10 firewall. There are two ways to open the firewall:
In the "Run" window, type wf.msc:
Or open the "Control Panel", click on the "System and Security", then click on the "Windows Firewall". Click on the "Advances settings".
It will open the "Windows Firewall with Advanced Security" windows.
There is "Inbound Rules" and "Outbound Rules" in the left part of the panel. The "Inbound Rules" are used to control data received by a program, and the "Outbound Rules" control the data that the program sends out. Click on the "Inbound Rules", then in the right panel, click on the "New Rule...".
You'll see the "New Inbound Rule Wizard"
Select "Program" and click on the "Next" button. You'll see the window in which you can select a program you want to block.
Select the "This program path" end enter the program you want to block.
Press the "Next" button, and select the "Block the connection" in the next screen:
Click the "Next" button again, and you see the page with profiles:
Check all of them, it will block the program over "Public" and "Private" networks. Click "Next". You'll see the last screen of the "New Inbound Rule Wizard".
Enter there any name you want, and click on the "Finish". Now in the central panel of the firewall you can see the new rule for the inbound connection. It will block any connection from the Internet to the program.
But this is not enough. You have also setup "Outbound Rules" for the program you want to block from sending data to the Internet. Click on the "Outbound Rules" and then click on the "New Rule...". You'll see the wizard, use it the same way as described above.
At the and, the "Outbound Rules" will contains the blocked item. Now test the program for both rules to be sure that it works.
If you want to unblock a blocked program, select it in the firewall, click "Delete" on the right panel. You have to do this for both "Inbound Rules" and "Outbound Rules".
You can watch this tutorial on youtube: How to block a program with Windows 10 firewall