This wikiHow teaches you how to stop the file sharing and/or internet connection feature on a Windows computer.
Step
Method 1 of 2: Disabling the File Sharing Feature on the Network

Step 1. Press Win+S
The Windows search bar will appear after that.
Use this method if you don't want other people connected to your home network to access the files on your computer

Step 2. Type in control panel
A list of search results will be displayed.

Step 3. Click Control Panel

Step 4. Click Network and Sharing Center

Step 5. Click Change advanced sharing settings
This option is the third link at the top of the left column.

Step 6. Click the network profile with the label “(current profile)” at the end of its name
With this option, you can change the sharing settings for the current connection. You may see “(current profile)” next to one of the following options:
-
“ Private:
Select this option for private connections, such as a home network.
-
“ Guest or public:
Select this option for the WiFi network you use in a public location or place (regardless of whether you need to enter a WiFi password or not).

Step 7. Select Turn off file and printer sharing
The dot will be displayed on the corresponding circle button. This means that the entry or option has been selected.

Step 8. Click Save changes
It's at the bottom of the screen. Now, you have disabled the file sharing feature on the currently active connection.
To disable the file sharing feature on other types of connections (e.g. profiles that are currently not in use), click again “ Changed advanced sharing settings ”, select another network profile, then click “ Turn off file and printer sharing " Don't forget to click " Save changes " after it finishes.
Method 2 of 2: Disabling Internet Network Sharing Feature

Step 1. Press Win+S
The Windows search bar will appear after that.
With this method, other people who are connected in the same Windows network cannot use your computer's internet connection

Step 2. Type in control panel
A list of search results will be displayed.

Step 3. Click Control Panel

Step 4. Click Network and Sharing Center
You can see the currently active connections under the “View your active networks” heading, at the top of the main pane. Remember the name of the currently active connection as you will need it.

Step 5. Click Change adapter settings
This option is the second link at the top of the left column. After that, a list of all saved connections will be displayed.

Step 6. Right-click the currently active connection
Look for a name that matches the connection name you previously viewed. A pop-up menu will appear after that.

Step 7. Click Properties
The “Connection Properties” dialog window will be displayed.

Step 8. Click the Sharing tab
This tab is at the top of the dialog window.
If the Sharing tab isn't available, you only have one network adapter enabled or you have one. You need to enable at least one more adapter temporarily

Step 9. Uncheck the option “Allow other network users to connect through this computer's internet connection”
Once the box is clicked, the tick will disappear.
If the box is empty, you don't need to make any changes

Step 10. Click OK
It's at the bottom of the dialog window. Once you disable the connection sharing feature, anyone who is on the same network cannot connect to the internet through your computer's internet connection.