File and printer sharing

On this page 7

File and printer sharing is the Windows feature that allows a computer to publish folders and printers to other devices on the local network, so that colleagues or family members can open files and print without copying data by hand. In Windows networking, it is the switch that activates the server side of the SMB protocol and opens the firewall ports it needs.

The setting lives in Advanced sharing settings and is configured separately for each network profile. It is typically on for private networks, off for public networks, and controlled by Group Policy in domains.

How file and printer sharing works

Turning the feature on does three things. It ensures the Server service (LanmanServer) is running, it enables the matching Windows Defender Firewall rules for the active network profile, and it allows the PC to answer requests for its shares and print queues. Sharing an individual folder or printer is a separate, deliberate step.

Clients connect with a UNC path such as \\OFFICE-PC\Projects and authenticate with an account that the sharing computer recognizes. Access is decided twice: first by share permissions, then by NTFS permissions on the folder, and the more restrictive result wins.

PortProtocolPurpose
TCP 445SMB over TCPFile access and printer traffic on modern Windows
TCP 139NetBIOS session serviceSMB for legacy clients
UDP 137 and 138NetBIOS name and datagramLegacy name resolution and browsing
ICMPv4 echoPingIncluded in the firewall rule group for diagnostics
Network ports used by file and printer sharing

Windows ties file and printer sharing to the network profile, so the same laptop can share at home and stay closed in a café or airport. The setting works alongside network discovery, which makes the PC visible in File Explorer but does not by itself grant access to anything.

Network profileDefault sharing stateRecommended use
PrivateUsually off until the user enables itTrusted home or small office networks
PublicOffHotels, cafés, airports and guest networks
DomainSet by Group PolicyCorporate networks managed by IT
Default behavior by network profile

Other options in the same panel shape behavior. Password protected sharing requires a valid account on the sharing PC, and public folder sharing exposes the C:\Users\Public folders to everyone on the network. Since the removal of HomeGroup in Windows 10 version 1803, these settings are the standard way to share in a workgroup.

Setting up a shared folder or printer

A reliable setup follows a fixed order, because skipping one step is the most common reason for “network path not found” errors. The steps below apply to Windows 10 and Windows 11.

  1. Set the connection to the Private network profile in Settings.
  2. Turn on file and printer sharing and, if browsing is wanted, network discovery.
  3. Share the folder through Properties, Sharing, Advanced Sharing, and set share permissions.
  4. Check NTFS permissions on the Security tab for the accounts that need access.
  5. For printers, enable Share this printer and confirm that client driver installation works.

Users then reach the share by name, by IP address or through a mapped network drive. In PowerShell, New-SmbShare and Get-SmbShare create and inspect shares, which is useful for scripted or repeated configurations.

Security considerations and hardening

File and printer sharing exposes a network service on port 445, which has been the entry point for some of the most damaging worms, including WannaCry through the EternalBlue exploit of SMBv1. Modern Windows removes SMBv1 by default, signs SMB traffic and supports SMB encryption, yet configuration still determines the real exposure.

RiskCauseMitigation
Worm propagationUnpatched SMB or enabled SMBv1Install updates, keep SMBv1 removed
Data exposureEveryone group with full controlGrant access to named accounts only
Internet exposurePort 445 forwarded on the routerNever forward SMB ports to the internet
Credential theftGuest or blank-password accessKeep password protected sharing on
PrintNightmare-type flawsVulnerable Print SpoolerPatch promptly, disable spooler where unused
Sharing risks and how to reduce them

Insecure guest logons are blocked by default in current Windows editions, and Windows 11 24H2 requires SMB signing by default. Older network storage devices that rely on guest access may therefore stop working, which is a security improvement rather than a fault to bypass.

Troubleshooting common sharing problems

Most sharing failures come from profile, firewall or credential mismatches, not from SMB itself. Checking the following points in order resolves the majority of cases:

  • The network is marked Public, so the firewall blocks inbound SMB.
  • A third-party firewall ignores the Windows rule group and blocks port 445.
  • Saved credentials conflict, resolved by removing old entries in Credential Manager.
  • Name resolution fails, tested by connecting with the IP address instead of the computer name.

A few built-in tools confirm each layer quickly. The table lists the checks that isolate the failing layer before any setting is changed.

CommandWhat it checksExpected result
Test-NetConnection -Port 445Reachability of the SMB portTcpTestSucceeded is True
Get-NetConnectionProfileActive network profileNetworkCategory is Private
Get-SmbShareShares published by the hostThe expected share is listed
net useCurrent client connectionsMapped drives show status OK
Diagnostic commands for sharing issues

Understanding it simply

File and printer sharing is the setting that lets your computer act like a small shared cabinet for the other computers in your home or office. Once it is on, you choose which folders or printers others may use, and they can open them over the network.

It is like leaving a specific drawer unlocked for your family while the rest of the house stays locked. Turn it on only on trusted networks, and keep it off in public places.

Applied in practice

A small architecture studio with six Windows 11 PCs and no server wants one place for project drawings and a single shared laser printer. The owner chooses the most powerful desktop as the host, marks its network as Private and turns on file and printer sharing.

A folder named Projects is shared with read and write access for a group containing the six staff accounts, while NTFS permissions keep an Accounts subfolder visible only to the owner. The USB printer attached to the same desktop is shared as StudioPrinter, and each workstation maps drive P: to the share.

The router never forwards port 445, and the host is set to install updates automatically. The studio gains shared storage and printing in an afternoon, at no extra cost, with access limited to named accounts.