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.
| Port | Protocol | Purpose |
|---|---|---|
| TCP 445 | SMB over TCP | File access and printer traffic on modern Windows |
| TCP 139 | NetBIOS session service | SMB for legacy clients |
| UDP 137 and 138 | NetBIOS name and datagram | Legacy name resolution and browsing |
| ICMPv4 echo | Ping | Included in the firewall rule group for diagnostics |
Network profiles and related settings
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 profile | Default sharing state | Recommended use |
|---|---|---|
| Private | Usually off until the user enables it | Trusted home or small office networks |
| Public | Off | Hotels, cafés, airports and guest networks |
| Domain | Set by Group Policy | Corporate networks managed by IT |
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.
- Set the connection to the Private network profile in Settings.
- Turn on file and printer sharing and, if browsing is wanted, network discovery.
- Share the folder through Properties, Sharing, Advanced Sharing, and set share permissions.
- Check NTFS permissions on the Security tab for the accounts that need access.
- 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.
| Risk | Cause | Mitigation |
|---|---|---|
| Worm propagation | Unpatched SMB or enabled SMBv1 | Install updates, keep SMBv1 removed |
| Data exposure | Everyone group with full control | Grant access to named accounts only |
| Internet exposure | Port 445 forwarded on the router | Never forward SMB ports to the internet |
| Credential theft | Guest or blank-password access | Keep password protected sharing on |
| PrintNightmare-type flaws | Vulnerable Print Spooler | Patch promptly, disable spooler where unused |
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.
| Command | What it checks | Expected result |
|---|---|---|
| Test-NetConnection -Port 445 | Reachability of the SMB port | TcpTestSucceeded is True |
| Get-NetConnectionProfile | Active network profile | NetworkCategory is Private |
| Get-SmbShare | Shares published by the host | The expected share is listed |
| net use | Current client connections | Mapped drives show status OK |
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.