How to Turn On or Off File and Printer Sharing in Windows 10
File and printer sharing is the ability of a computer running Windows to share a folder or attached printer with other computers on a network.
- File sharing allows you to make files and folders in a shared folder accessible to others on the network to view, copy, or modify.
- Printer sharing allows you to make an attached printer available to other computer users on the network.
If you are connected to a public network location (ex: café or library), then you may wish to turn off file and printer sharing until you are connected to a private network location (ex: home or work).
This tutorial will show you how to turn on or off file and printer sharing on your Windows 10 PC.
You must be signed in as an administrator to be able to turn on or off file and printer sharing.
If your networked computers are not showing in File Explorer, then make sure the Function Discovery Provider Host and Function Discovery Resource Publication services are enabled, set to Automatic, and running.
Contents
- Option One: To Turn On or Off File and Printer Sharing in Network and Sharing Center
- Option Two: To Turn On or Off File and Printer Sharing for All Network Profiles in Command Prompt
- Option Three: To Turn On or Off File and Printer Sharing in PowerShell
- Option Four: To Turn On or Off File and Printer Sharing for Microsoft Networks in Network Properties
- Option Five: To Turn On or Off File and Printer Sharing for Microsoft Networks in PowerShell
If you turned off File and Printer Sharing for Microsoft Networks using Option Four or Option Four for a network adapter, then this option will not actually be effective until you turn on File and Printer Sharing for Microsoft Networks for the network adapter.
1 Open the Control Panel (icons view), and click/tap on the Network and Sharing Center icon.
2 Click/tap on the Change advanced sharing settings link on the left side. (see screenshot below)
3 Expand openthe Private or Guest or Public network profile for the one you want to turn on or off file and printer sharing. (see screenshots below step 4)
4 Select (dot) Turn on file and printer sharing or Turn off file and printer sharing for what you want to do, and click/tap on Save changes. (see screenshots below)
5 When finished, you can close Network and Sharing Center if you like.
6 If you turned on file and printer sharing, then you will also need to turn on File and Printer Sharing for Microsoft Networks using Option Four below.
If you turned off File and Printer Sharing for Microsoft Networks using Option Four or Option Four for a network adapter, then this option will not actually be effective until you turn on File and Printer Sharing for Microsoft Networks for the network adapter.
1 Open an elevated command prompt.
2 Do step 3 (on) or step 4 (off) below for what you want to do.
A) Copy and paste the command below into the elevated command prompt, press Enter, and go to step 5 below. (see screenshot below)
netsh advfirewall firewall set rule group="File and Printer Sharing" new enable=Yes
A) Copy and paste the command below into the elevated command prompt, press Enter, and go to step 5 below. (see screenshot below)
netsh advfirewall firewall set rule group="File and Printer Sharing" new enable=No
5 You can now close the elevated command prompt if you like.
6 If you turned on file and printer sharing, then you will also need to turn on File and Printer Sharing for Microsoft Networks using Option Four below.
To see more usage options for the Set-NetFirewallRule command, see: Set-NetFirewallRule | Microsoft Docs
If you turned off File and Printer Sharing for Microsoft Networks using Option Four or Option Four for a network adapter, then this option will not actually be effective until you turn on File and Printer Sharing for Microsoft Networks for the network adapter.
1 Open an elevated PowerShell.
2 Do step 3 (on) or step 4 (off) below for what you want to do.
A) Copy and paste the command below you want to use into the elevated PowerShell, press Enter, and go to step 5 below.
(Apply to all network profiles)
Set-NetFirewallRule -DisplayGroup "File And Printer Sharing" -Enabled True -Profile Any
OR
(Apply to "Domain" network profile)
Set-NetFirewallRule -DisplayGroup "File And Printer Sharing" -Enabled True -Profile Domain
OR
(Apply to "Private" network profile)
Set-NetFirewallRule -DisplayGroup "File And Printer Sharing" -Enabled True -Profile Private
OR
(Apply to "Public" network profile)
Set-NetFirewallRule -DisplayGroup "File And Printer Sharing" -Enabled True -Profile Public
A) Copy and paste the command below into the elevated command prompt, press Enter, and go to step 5 below. (see screenshot below)
(Apply to all network profiles)
Set-NetFirewallRule -DisplayGroup "File And Printer Sharing" -Enabled False -Profile Any
OR
(Apply to "Domain" network profile)
Set-NetFirewallRule -DisplayGroup "File And Printer Sharing" -Enabled False -Profile Domain
OR
(Apply to "Private" network profile)
Set-NetFirewallRule -DisplayGroup "File And Printer Sharing" -Enabled False -Profile Private
OR
(Apply to "Public" network profile)
Set-NetFirewallRule -DisplayGroup "File And Printer Sharing" -Enabled False -Profile Public
5 You can now close the elevated PowerShell if you like.
6 If you turned on file and printer sharing, then you will also need to turn on File and Printer Sharing for Microsoft Networks using Option Four below.
This option is the same as doing Option Five.
1 Open the Control Panel (icons view), and click/tap on the Network and Sharing Center icon.
2 Click/tap on the Change adapter settings link on the left side. (see screenshot below)
3 Right click or press and hold on the network adapter (ex: Ethernet 2) you want to turn on or off file and printer sharing for Microsoft networks, and click/tap on Properties. (see screenshot below)
4 Check (turn on - default) or uncheck (turn off) File and Printer Sharing for Microsoft Networks for what you want, and click/tap on OK. (see screenshot below)
5 If you turned on file and printer sharing for Microsoft networks, then you will also need to turn on file and printer sharing using Option One, Option Two, or Option Three above.
This option is the same as doing Option Four.
For moreEnable-NetAdapterBinding
command usage options, see: Enable-NetAdapterBinding | Microsoft Docs
For moreDisable-NetAdapterBinding
command usage options, see: Disable-NetAdapterBinding | Microsoft Docs
1 Open an elevated PowerShell.
2 Copy and paste the command below into the elevated PowerShell, and press Enter. Make note of the network adapter name (ex: "Ethernet") you want to turn on or off file and printer sharing for Microsoft networks. (see screenshot below)
Get-NetAdapter | Format-Table -AutoSize
3 Do step 4 (on) or step 5 (off) below for what you want to do.
This is the default setting.
A) Type either command below into the elevated PowerShell, press Enter, and go to step 6. (see screenshot below)
Enable-NetAdapterBinding -Name "<Network Adapter Name>" -ComponentID ms_server
OR
Enable-NetAdapterBinding -Name "<Network Adapter Name>" -DisplayName "File and Printer Sharing for Microsoft Networks"
Substitute <Network Adapter Name> in the command above with the actual network adapter name (ex: "Ethernet") from step 2 you want to turn on file and printer sharing for Microsoft networks.
For example:Enable-NetAdapterBinding -Name "Ethernet" -ComponentID ms_server
A) Type either command below into the elevated PowerShell, press Enter, and go to step 6. (see screenshot below)
Disable-NetAdapterBinding -Name "<Network Adapter Name>" -ComponentID ms_server
OR
Disable-NetAdapterBinding -Name "<Network Adapter Name>" -DisplayName "File and Printer Sharing for Microsoft Networks"
Substitute <Network Adapter Name> in the command above with the actual network adapter name (ex: "Ethernet") from step 2 you want to turn off file and printer sharing for Microsoft networks.
For example:Disable-NetAdapterBinding -Name "Ethernet" -ComponentID ms_server
6 If you turned on file and printer sharing for Microsoft networks, then you will also need to turn on file and printer sharing using Option One, Option Two, or Option Three above.
That's it,
Shawn
Related Tutorials
- How to Share a Printer in Windows 10
- How to Turn On or Off Network Discovery in Windows 10
- How to Set Network Location to be Public, Private, or Domain in Windows 10
- How to Add or Remove 'Share with' Context Menu in Windows 10
- How to Turn On or Off Password Protected Sharing in Windows 10
- How to Turn On or Off Public Folder Sharing in Windows 10
- How to Change File Sharing Encryption Level in Windows 10
- How to Add Share to Context Menu of Files in Windows 10
- How to Share Files and Folders Over a Network in Windows 10
- How to View All Network Shares on a Windows PC