Windows 11是(Windows 11)微软(Microsoft) 开发的一系列操作系统之一。一个系统与另一个系统的网络(Network)共享和通信一直是Microsoft操作系统中的重中之重。在各种共享功能中,文件和打印机共享(File and Printer Sharing)在用户中非常受欢迎。在此功能中,文件共享允许在网络之间交换文件和数据,而打印共享允许一个用户将打印作业从一个网络发送到另一个网络的连接打印机。Windows 11/10中打开或关闭文件和打印机共享。
Microsoft始终建议关闭文件和打印共享功能,以防止文件通过无线网络自动共享。这些功能也是必不可少的,可以使冗长的任务变得容易,但允许系统访问彼此的数据并发送命令。
在Windows 11/10中打开或关闭文件(Off File)和打印机共享(Printer Sharing)
文件共享帮助通过网络共享在同一连接上连接的其他用户访问、阅读和编辑其他用户的文件。打印(Print)共享允许连接在同一网络上的用户将打印作业从他们的系统发送到您的打印机。出于安全考虑,用户还可能希望在连接到公共网络时关闭此功能。
在打开该功能之前,请确保在网络(Networks)适配器属性窗口中启用了Microsoft的(Microsoft)文件和打印机共享选项。(File and Printer Sharing for)
- 为此,请先打开“控制面板”(open the Control Panel)窗口。
- 将视图设置为类别(Category)
- 然后转到网络和 Internet(Network and Internet) >网络和共享中心 (Network and Sharing Center )>更改适配器设置(Change adapter settings)。
- 右键单击要启用或禁用的网络适配器,然后从上下文菜单中选择“属性”选项。(Properties)
- 在网络选项卡上,选中(Networking)Microsoft 网络(File and Printer Sharing for Microsoft Networks )的文件和打印机共享选项旁边的框。
- 然后单击确定(OK)按钮并关闭窗口。
阅读(Read):如何共享和添加网络打印机(How to share and add Network Printer)。
现在您需要打开系统上的文件和打印机共享。您可以使用三种方法在Windows 10(Windows 10)中打开和关闭文件和打印机共享:
- 通过控制面板。
- 使用命令提示符。
- 通过 Windows PowerShell。
现在让我们详细解释所有方法:
1]通过控制面板(Control Panel)启用文件(Enable File)和打印机共享(Printer Sharing)
文件和打印共享可以通过控制面板轻松访问和控制。请按照以下建议继续:
- 打开控制面板。
- 单击网络和 Internet(Network and Internet)。
- 选择网络和共享中心(Network and Sharing Center)。
- 然后单击更改高级共享设置 (Change advanced sharing settings )选项。
- 如果要启用此选项,请转到文件和打印机共享(File and printer sharing)部分并选中打开文件和打印机共享(Turn on file and printer sharing )框。并选中关闭文件和打印机共享(Turn off file and printer sharing)框以禁用该选项。
现在让我们详细了解上述步骤:
要开始使用,请先打开控制面板(Control Panel)。打开后,确保 View by 设置为Category。
现在在控制面板中, (, )转到网络和 Internet(Network and Internet)。
此外,选择网络和共享中心( Network and Sharing Center)。网络(Network)和共享中心(Sharing Center)窗口将有几个选项,您必须从中选择更改高级共享设置(Change advanced sharing settings)。
高级共享设置(Advanced Sharing Settings)窗口将出现在您的屏幕上,其中包含网络(Network)发现和文件(File)和打印机共享选项,如上图所示。在文件(File)和打印机共享下选择打开文件和打印机共享(Turn on file and printer sharing)并保存更改(Save changes)。
尽管如果您的设备中已经启用了此选项并且现在您希望将其关闭,那么只需选中关闭文件和打印机共享(Turn off file and printer sharing )选项旁边的框即可。然后单击保存更改(Save changes)按钮以应用设置。
阅读(Read):文件共享在 Windows 中不起作用。
2]使用命令提示符(Command Prompt)打开文件(Turn)和(File)打印机共享(Printer Sharing)
也可以使用命令提示符启用或禁用文件和打印机共享。为此,首先以管理员身份运行命令提示符(run Command Prompt as an administrator)。
在提升的命令提示符(Command Prompt)窗口中,键入以下文本代码并按Enter键为所有网络配置文件启用文件和打印机共享服务:
netsh advfirewall firewall set rule group="File and Printer Sharing" new enable=Yes
如果要禁用文件和打印机共享,请复制并粘贴以下命令,然后按Enter键:
netsh advfirewall firewall set rule group="File and Printer Sharing" new enable=No
现在你准备好了。检查是否完成。
阅读(Read):在 Windows 沙盒中启用或禁用打印机共享。(Enable or disable Printer Sharing in Windows Sandbox.)
3]通过 PowerShell启用(Enable)或禁用文件(Disable File)和打印机共享(Printer Sharing)
您还可以使用Windows PowerShell应用程序打开或关闭文件和打印机共享功能。
为此,请先打开提升的 PowerShell 提示符(open an elevated PowerShell prompt)。
现在复制并粘贴下面的命令行,然后按 Enter(Enter)执行它。您可以为相关的网络配置文件运行特定的命令行:
Set-NetFirewallRule -DisplayGroup "File And Printer Sharing" -Enabled True -Profile Any
Set-NetFirewallRule -DisplayGroup "File And Printer Sharing" -Enabled True -Profile Domain
Set-NetFirewallRule -DisplayGroup "File And Printer Sharing" -Enabled True -Profile Private
Set-NetFirewallRule -DisplayGroup "File And Printer Sharing" -Enabled True -Profile Public
同样,如果要关闭此功能,请为相关配置文件运行特定命令:
Set-NetFirewallRule -DisplayGroup "File And Printer Sharing" -Enabled False -Profile Any
Set-NetFirewallRule -DisplayGroup "File And Printer Sharing" -Enabled False -Profile Domain
Set-NetFirewallRule -DisplayGroup "File And Printer Sharing" -Enabled False -Profile Private
Set-NetFirewallRule -DisplayGroup "File And Printer Sharing" -Enabled False -Profile Public
运行命令后,现在关闭PowerShell窗口。
就是这样。希望能帮助到你。
阅读(Read):文件和打印共享资源在线,但未响应连接尝试。
How to Turn On or Off File and Printer Sharing in Windows 11/10
Windows 11 is one of the series of operating systems developed by Microsoft. Network sharing and communication of one system with another has always been an element of great priority in Microsoft operating systems. Out of various sharing features, File and Printer Sharing is quite popular among the users. In this feature, file sharing allows the exchange of files and data between networks, and print sharing allows one user to send print jobs from one network to the other network’s attached printer. This post will guide you on how to turn on or off file and printer sharing in Windows 11/10.
It is always recommended by Microsoft to turn off file and print sharing features to protect the files from getting shared automatically through the wireless network. These features are also essential and make lengthy tasks easy but allowing the systems to access each other’s data and send commands.
Turn On or Off File and Printer Sharing in Windows 11/10
File sharing helps the other user connected through network sharing on the same connection to access, read and edit the files of the other user. Print sharing allows the users connected on the same network to send print jobs from their system to your printer. Users may also wish to turn off this feature when connected to public networks for security purposes.
Before you turn the feature On, make sure the File and Printer Sharing for Microsoft option is enabled in the Networks adapter properties window.
- To do so, open the Control Panel window first.
- Set the View by as Category
- Then go to Network and Internet > Network and Sharing Center > Change adapter settings.
- Right-click on your network adapter which you want to enable or disable and then select the Properties option from the context menu.
- On the Networking tab, check the box next to the File and Printer Sharing for Microsoft Networks option.
- Then click on the OK button and close the window.
Read: How to share and add Network Printer.
Now you will need to turn on the file and printer sharing on your system. There are three methods that you can use for turning on and off file and printer sharing in Windows 10:
- Through the Control Panel.
- Using the Command Prompt.
- Via the Windows PowerShell.
Let’s now explain all the methods in detail:
1] Enable File and Printer Sharing through Control Panel
The file and print sharing can be easily accessed and control through the control panel. Follow the below suggestions to continue:
- Open the Control Panel.
- Click Network and Internet.
- Select Network and Sharing Center.
- Then click on the Change advanced sharing settings option.
- If you want to enable this option, go to the File and printer sharing section and check the Turn on file and printer sharing box. And check the Turn off file and printer sharing box to disable the option.
Let’s now see the above steps in details:
To get it started, open the Control Panel first. Once it opens, make sure that View by is set as Category.
Now inside the Control Panel, go to Network and Internet.
Further, choose Network and Sharing Center. The Network and Sharing Center window will have several options out of which you have to select Change advanced sharing settings.
The Advanced Sharing Settings window will appear on your screen with Network discovery and File and printer sharing options as shown in the above image. Under the File and printer sharing select Turn on file and printer sharing and Save changes.
Although if this option is already enabled in your device and now you are looking to turn it off then simply check the box next to the Turn off file and printer sharing option. Then click on the Save changes button to apply the settings.
Read: File Sharing is not working in Windows.
2] Turn On File and Printer Sharing using Command Prompt
The file and printer sharing can also be enabled or disabled using the command prompt. To do so, run Command Prompt as an administrator first.
Inside the elevated Command Prompt window, type the following text code and press the Enter key to enable the file and printer sharing service for all network profiles:
netsh advfirewall firewall set rule group="File and Printer Sharing" new enable=Yes
If you want to disable the file and printer sharing, copy and paste the following command and then hit the Enter key:
netsh advfirewall firewall set rule group="File and Printer Sharing" new enable=No
Now you are ready to go. Check if it is done.
Read: Enable or disable Printer Sharing in Windows Sandbox.
3] Enable or Disable File and Printer Sharing via PowerShell
You can also use your Windows PowerShell application to turn on or off file and printer sharing features.
To do this, open an elevated PowerShell prompt first.
Now copy and paste the below command line and then hit Enter to execute it. You can run the particular command line for the relevant network profiles:
- For all the network profiles:
Set-NetFirewallRule -DisplayGroup "File And Printer Sharing" -Enabled True -Profile Any
- For the Domain network profile:
Set-NetFirewallRule -DisplayGroup "File And Printer Sharing" -Enabled True -Profile Domain
- For the Private network profile:
Set-NetFirewallRule -DisplayGroup "File And Printer Sharing" -Enabled True -Profile Private
- For the Public network profile:
Set-NetFirewallRule -DisplayGroup "File And Printer Sharing" -Enabled True -Profile Public
Similarly, if you want to turn this feature off, then run the specific command for the relevant profile:
- For all the network profiles:
Set-NetFirewallRule -DisplayGroup "File And Printer Sharing" -Enabled False -Profile Any
- For the Domain network profile:
Set-NetFirewallRule -DisplayGroup "File And Printer Sharing" -Enabled False -Profile Domain
- For the Private network profile:
Set-NetFirewallRule -DisplayGroup "File And Printer Sharing" -Enabled False -Profile Private
- For the Public network profile:
Set-NetFirewallRule -DisplayGroup "File And Printer Sharing" -Enabled False -Profile Public
After running the command, now close the PowerShell window.
That’s it. Hope it helps.
Read: File and Print sharing resource is online but isn’t responding to connection attempts.