Introduction
In this article, I describe how to enable or disable file and printer sharing in Windows 10. This is a key feature in the Windows family for sharing files and printers on the network with other users.
We can also use this feature in Windows 10 to share files and printers on the network. The file-sharing feature is a process that enables the user to share files in a shared folder that are accessible to other users on the same network. Similarly, the printer-sharing feature allows multiple computers to connect to the same network to access common printers. When the file and printer sharing feature is turned on, the files and printers that you share from the computer are accessed by other users on the same network.
When we need to share the file and printer with other users on the network, we have different options to enable it to use different methods such as command prompt, Windows PowerShell, and control panel.
This tutorial will show you the steps on how to enable or disable file and printer sharing in Windows 10.
Method 1. Using Command Prompt
By using the Command Prompt (Admin), the user can easily enable or disable file and printer sharing options. Follow the below instructions to proceed.
Step 1. From the Search, type the Command Prompt right-click on it, and select "Run as Administrator".
Step 2
A) To turn off (disable) the file and printer sharing option, type the following command in the command prompt.
netsh advfirewall firewall set rule group="File and Printer Sharing" new enable=No

B)To turn on the file and printer sharing, type the following command in the command prompt.
netsh advfirewall firewall set rule group="File and Printer Sharing" new enable=Yes

Method 2. Using Windows PowerShell (Admin)
By using Windows PowerShell, the user can easily enable or disable file and printer sharing options. Follow the below instructions to proceed.
Step 1. Open Windows PowerShell (Admin). (Alternatively, you can press the "Windows + X" key and click on "Windows PowerShell (Admin)" to open it.)
Step 2
A) To turn off (disable) the File and printer sharing option for different profiles, type the following command in the Windows PowerShell (Admin).
1) For all Network Profile
Set-NetFirewallRule -DisplayGroup "File And Printer Sharing" -Enabled False -Profile Any

2) Similarly, for the Public Network Profile
Set-NetFirewallRule -DisplayGroup "File And Printer Sharing" -Enabled False -Profile Public








Join the conversation! Your thoughts help the community grow.