Turn On or Off File and Printer Sharing in Windows 10  

Page 1 of 5 123 ... LastLast
    Turn On or Off File and Printer Sharing in Windows 10

    Turn On or Off File and Printer Sharing in Windows 10

    How to Turn On or Off File and Printer Sharing in Windows 10
    Published by Category: Network & Sharing
    25 Oct 2020
    Designer Media Ltd

    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






    OPTION ONE

    To Turn On or Off File and Printer Sharing in Network and Sharing Center


    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)

    Turn On or Off File and Printer Sharing in Windows 10-file_and_printer_sharing_network_and_sharing_center-1.png

    3 Expand open Turn On or Off File and Printer Sharing in Windows 10-arrow.jpg the 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)

    Turn On or Off File and Printer Sharing in Windows 10-file_and_printer_sharing_network_and_sharing_center-2.png
    Turn On or Off File and Printer Sharing in Windows 10-file_and_printer_sharing_network_and_sharing_center-3.png

    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.






    OPTION TWO

    To Turn On or Off File and Printer Sharing for All Network Profiles in Command Prompt


    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.


     3. To Turn On File and Printer Sharing for All Network Profiles

    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

    Turn On or Off File and Printer Sharing in Windows 10-file_and_printer_sharing_command-2.png


     4. To Turn Off File and Printer Sharing for All Network Profiles

    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

    Turn On or Off File and Printer Sharing in Windows 10-file_and_printer_sharing_command-1.png


    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.






    OPTION THREE

    To Turn On or Off File and Printer Sharing in PowerShell


    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.


     3. To Turn On File and Printer Sharing

    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


     4. To Turn Off File and Printer Sharing

    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.






    OPTION FOUR

    To Turn On or Off File and Printer Sharing for Microsoft Networks in Network Properties


    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)

    Turn On or Off File and Printer Sharing in Windows 10-file_and_printer_sharing_for_microsoft_networks-1.png

    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)

    Turn On or Off File and Printer Sharing in Windows 10-file_and_printer_sharing_for_microsoft_networks-2.png

    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)

    Turn On or Off File and Printer Sharing in Windows 10-file_and_printer_sharing_for_microsoft_networks-3.png

    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.






    OPTION FIVE

    To Turn On or Off File and Printer Sharing for Microsoft Networks in PowerShell


    This option is the same as doing Option Four.

    For more Enable-NetAdapterBinding command usage options, see: Enable-NetAdapterBinding | Microsoft Docs

    For more Disable-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

    Turn On or Off File and Printer Sharing in Windows 10-file_and_printer_sharing_for_microsoft_networks_powershell-1.png

    3 Do step 4 (on) or step 5 (off) below for what you want to do.


     4. To Turn On File and Printer Sharing for Microsoft Networks

    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

    Turn On or Off File and Printer Sharing in Windows 10-file_and_printer_sharing_for_microsoft_networks_powershell-3.png


     5. To Turn Off File and Printer Sharing for Microsoft Networks

    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

    Turn On or Off File and Printer Sharing in Windows 10-file_and_printer_sharing_for_microsoft_networks_powershell-2.png


    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






  1. Posts : 2,450
    Windows 10 Pro x64
       #1

    If I may add to OPTION ONE of Shawn's excellent tutorial, one more useful setting is the Password Protection, which can be found in:

    All Networks > Password protected sharing.

    In that section, password protection for shared folders/files can be set.

    Turn On or Off File and Printer Sharing in Windows 10-all-networks-sharing.png
      My Computer


  2. Posts : 68,658
    64-bit Windows 11 Pro for Workstations
    Thread Starter
       #2

    You read my mind. That's going to be the next tutorial.

    UPDATE: How to Turn On or Off Password Protected Sharing in Windows 10
    Last edited by Brink; 10 May 2016 at 12:29.
      My Computers


  3. Posts : 2,450
    Windows 10 Pro x64
       #3

    Great minds think alike!!!
      My Computer


  4. Posts : 4
    Windows 10
       #4

    info bar side effect


    Hello Brink. Thanks for the nice tutorial. I used your 'Option Three' to turn off sharing of this PC's local resources. It worked just fine, and I'm still able to reach out and access remote resources on the network. Everything is functioning well.

    There seems to be one side effect since turning it off, though. An annoying info bar message in This PC/Windows Explorer whenever browsing the network.
    Turn On or Off File and Printer Sharing in Windows 10-2016_05_17_10_41_16_.jpg

    It can be X'd away but will reappear next time the network is browsed or whenever navigating into the network section of Windows Explorer.

    To test, I went to a Windows 8 PC and turned off File & Printer Sharing on the adapter options (same as I did on the Win10 PC). On that OS, no yellow info bar message popped up while browsing the network. So it seems to be a Win 10 behavior.

    Do you know any tips to hide or disable that message in Windows 10? Thank you.
      My Computer


  5. Posts : 68,658
    64-bit Windows 11 Pro for Workstations
    Thread Starter
       #5

    Hello steampunk, :)

    Yeah, that pop-up is annoying. I'm not aware of a way to disable it so far though.
      My Computers


  6. Posts : 6
    Windows 10
       #6

    I was looking for a way to enable File Sharing only for private profile, and found a powershell command to do it. You might add it to your excellent tutorial

    Code:
    Set-NetFirewallRule -DisplayGroup "File And Printer Sharing" -Enabled True -Profile Private
      My Computer


  7. Posts : 68,658
    64-bit Windows 11 Pro for Workstations
    Thread Starter
       #7

    Thank you @aixki. :)

    I have added this as Option 3 in the tutorial so it can help others.

    Turn On or Off File and Printer Sharing in Windows 10 Windows 10 Network Sharing Tutorials
      My Computers


  8. Posts : 9
    Win 8.1
       #8

    Im tried option 3 but i got this

    PS C:\WINDOWS\system32> Set-NetFirewallRule -DisplayGroup "File And Printer Sharing" -Enabled True -Profile Private
    Set-NetFirewallRule : No MSFT_NetFirewallRule objects found with property 'DisplayGroup' equal to 'File And Printer Sha
    ring'. Verify the value of the property and retry.
    At line:1 char:1
    + Set-NetFirewallRule -DisplayGroup "File And Printer Sharing" -Enabled ...
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : ObjectNotFound: (File And Printer Sharing:String) [Set-NetFirewallRule], CimJobException
    + FullyQualifiedErrorId : CmdletizationQuery_NotFound_DisplayGroup,Set-NetFirewallRule
      My Computer


  9. Posts : 68,658
    64-bit Windows 11 Pro for Workstations
    Thread Starter
       #9

    Hello Viper, and welcome to Ten Forums. :)

    The output indicate that it couldn't find any firewall rules with the "File And Printer Sharing" name under "DisplayGroup".

    As a test to verify this, what do you get using the commands below? I'm thinking that this may be a language issue, and "File And Printer Sharing" needs to be translated for your language.

    (English)
    Get-NetFirewallRule -DisplayGroup "File And Printer Sharing"

    (Swedish)
    Get-NetFirewallRule -DisplayGroup "Fil- och skrivardelning"


    Are you able to use any of the other options in the tutorial to set this?
    Last edited by Brink; 22 Sep 2017 at 10:24.
      My Computers


 

Tutorial Categories

Turn On or Off File and Printer Sharing in Windows 10 Tutorial Index Network & Sharing Instalation and Upgrade Browsers and Email General Tips Gaming Customization Apps and Features Virtualization BSOD System Security User Accounts Hardware and Drivers Updates and Activation Backup and Restore Performance and Maintenance Mixed Reality Phone


  Related Discussions
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 12:23.
Find Us




Windows 10 Forums