Automatically configure Windows file and printer sharing across LAN networks. Works with mixed environments including older Windows versions (Windows 7/8/10/11) by enabling SMBv1 support.
- Enables Network Discovery and File/Printer Sharing
- Configures required Windows services (Function Discovery, SSDP, UPnP, SMB)
- Enables SMBv1 for compatibility with legacy Windows systems
- Enables Guest (anonymous) access for open, password-free sharing
- Sets network profile to Private for LAN access
- Configures registry settings for guest access and anonymous connections
- Automatic registry backup before any changes
- Post-installation verification tool
- One-click restore to default settings
- Detailed logging of all operations
| File | Description |
|---|---|
install.bat |
Main installer - configures sharing settings (run as Admin) |
fix-guest-access.ps1 |
Helper used by install.bat - grants Guest network logon + relaxes SMB signing |
verify.bat |
Post-reboot verification tool |
restore.bat |
Restore all settings to Windows defaults |
client.bat |
Run on each OTHER PC - allows it to open \\SERVER\share as guest |
install.bat
│
├── Backup registry (auto-saved to registry-backup/)
├── Set network profile → Private
├── Enable firewall rules (Network Discovery + File Sharing)
├── Start & auto-enable 6 required services
├── Enable SMBv1 (skip if already enabled)
├── Configure registry for guest/anonymous access
├── Enable Guest account + open sharing (forceguest=1, LimitBlankPasswordUse=0)
├── Grant Guest network logon + relax SMB signing via fix-guest-access.ps1
└── Reboot in 10 seconds (Ctrl+C to cancel)
verify.bat (after reboot)
│
├── Check network profile status
├── Verify firewall rules
├── Check all services running
├── Confirm SMBv1 state
├── Verify registry settings
├── List shared folders
└── Show access test instructions
restore.bat (if something goes wrong)
│
├── Import registry backups
├── Reset network profile → Automatic
├── Disable sharing firewall rules
└── Reset services to manual
- Download - Clone or download this repository
- Install - Right-click
install.bat> Run as Administrator - Reboot - System will reboot automatically after 10 seconds
- Verify - After reboot, run
verify.batto confirm settings
git clone https://github.com/ngodingsendiri/Sharingwindows.git
cd Sharingwindows
install.bat
# Normal install (reboots after 10 seconds)
install.bat
# Install without reboot (manual reboot required)
install.bat --no-reboot
# Silent install (no console output, log only)
install.bat --quiet
# Fully silent, no reboot
install.bat --quiet --no-reboot
# Show help
install.bat --helpFor silent deployment across multiple PCs:
install.bat --quiet --no-rebootThis will:
- Run without any console window
- Write all output to
sharing-setup.log - Skip automatic reboot (reboot handled by your deployment tool)
- Windows 7 / 8 / 10 / 11
- Administrator privileges
- PowerShell (pre-installed on Windows 10+)
| Service | Description |
|---|---|
| fdPHost | Function Discovery Provider Host |
| FDResPub | Function Discovery Resource Publication |
| SSDPSRV | SSDP Discovery |
| upnphost | UPnP Device Host |
| LanmanServer | SMB Server |
| LanmanWorkstation | SMB Client |
| Key | Value | Purpose |
|---|---|---|
| AllowInsecureGuestAuth | 1 | Allow guest login to SMB shares |
| everyoneincludesanonymous | 1 | Include anonymous in Everyone group |
| restrictanonymous | 0 | Allow anonymous enumeration |
| AutoShareWks | 1 | Enable admin share auto-creation |
| forceguest | 1 | Map all network access to the Guest account |
| LimitBlankPasswordUse | 0 | Allow password-free (guest) network logon |
Guest access also enables the Guest account (net user Guest /active:yes).
- Network Discovery
- File and Printer Sharing
This tool is designed for networks with a mix of old and new Windows versions:
- Windows 7/8 - SMBv1 is enabled by default, no additional config needed
- Windows 10/11 - SMBv1 is disabled by default, this script enables it
Note: If all PCs run Windows 10 or newer, you may want to use SMBv2/v3 only for better security. SMBv1 is only needed for legacy compatibility.
Since v1.2.0 install.bat opens the network for password-free guest access. Since v1.3.0 this fully works on modern Windows:
- Enables the local Guest account
- Sets
forceguest=1(all remote logons map to Guest) - Sets
LimitBlankPasswordUse=0(password-free logon allowed) - Grants the Guest / Guests groups the "Access this computer from the network" right (
SeNetworkLogonRight) and removes the network-deny right - Disables required SMB signing on server and client (a guest session cannot sign, so requiring it blocks guest access)
- Opens anonymous/null-session access (
RestrictNullSessAccess=0,restrictanonymoussam=0)
Security warning: This makes shares open to anyone on the LAN without a password. Only use on trusted networks (e.g. home/office behind a firewall). Reboot is recommended for the new security model to take full effect.
Modern Windows 10/11 clients block insecure guest logons by default. On each other PC, run client.bat (as Administrator), then open \\SERVER\SERVER. Alternatively tick "connect using different credentials" and use username Guest with a blank password.
To undo all changes and restore Windows default settings:
- Run
restore.batas Administrator - Confirm the operation
- Reboot when prompted
Note:
restore.batrolls back the registry (from the backup made byinstall.bat) and sharing services. The Guest network-logon grant and the SMB-signing relaxation done byfix-guest-access.ps1are authority/SMB policy changes — to fully revert them, use the local security editor or run a separate hardening step. Runclient.baton other PCs first if you still need access.
All operations are logged to sharing-setup.log in the same directory. The log includes:
- Success/failure status for each operation
- Error details if any operation fails
- Registry backup locations
- Run
verify.batto check which settings are not active - Ensure both PCs are on the same network/subnet
- Check if third-party firewall software is blocking connections
- Try accessing
\\COMPUTERNAME\from the other PC
- Verify Network Discovery is enabled in Firewall
- Ensure all PCs have the same Workgroup name
- Check that required services are running
- On the other PC run
client.batas Administrator (enables insecure guest logon) - Open
\\SERVER\SERVER, or use connect using different credentials →Guest+ blank password - Modern Windows 10/11 clients block guest by default;
client.batfixes that
- Make sure you're running the scripts as Administrator
- Check User Account Control (UAC) settings
MIT License - Feel free to use, modify, and distribute.
See CHANGELOG.md for version history.