Disable hidden remote file access via administrative shares (breaks remote system management software)
- Windows onlyThis script improves your privacy on Windows
- Single actionThis page belongs to a script, containing basic changes to achieve a task.
- Impact: Medium
System Functionality / Data Loss Risk: Moderate
This action improves privacy with minimal impact when you run the recommended script.
This action improves privacy with some impact when you run the recommended script. - Batch (batchfile)These changes use Windows system commands to update your settings.
- Administrator rights requiredThis script requires privilege access to do the system changes
- Fully reversible
You can fully restore this action (revert back to the original behavior) using this website.
The restore/revert methods provided here can help you fix issues.
Overview
This script improves your privacy and security by disabling Windows administrative shares, which are typically used for remote access to your computer's file system.
Windows automatically creates hidden administrative shares, such as C$
and D$
, that allow system administrators remote access to
every disk volume on your computer 1 2. These shares are often targeted as potential attack vectors 3.
Disabling administrative shares is generally a good practice for enhancing security. It is recommended by various security standards and compliance frameworks, including some government standards 3, PCI-DSS 4, and CIS 2. It reduces the system's vulnerability to unauthorized remote access.
These shares are often used for system administrators to perform tasks like software installation and vulnerability scanning remotely 1. Disabling them may limit remote management capabilities. This might require setting up network shares manually for specific folders or drives, which is more secure but requires additional effort.
Some software, such as Microsoft Systems Management Server (SMS) 2, Microsoft Operations Manager 2, Microsoft PsTools 5, and certain third-party network backup applications 2, rely on administrative shares. Therefore, disabling these shares could disrupt their functionality.
This may lead to reduced functionality or connectivity issues, particularly in enterprise environments where remote administration is necessary.
This script is only recommended if you understand its implications.
Some non-critical or features may no longer function correctly after running this script.
This script can be fully reversed to restore changes if something goes wrong.
Sources
- Remove administrative shares - Windows Server. Microsoft Learn. learn.microsoft.com. (2023).
Original: https://learn.microsoft.com/en-us/troubleshoot/windows-server/networking/remove-administrative-shares
Archived: https://web.archive.org/web/20230831114315/https://learn.microsoft.com/en-us/troubleshoot/windows-server/networking/remove-administrative-shares - CIS Microsoft Windows 8 Benchmark. itref.ir. (2023).
Original: http://www.itref.ir/uploads/editor/1edad0.pdf
Archived: https://web.archive.org/web/20231206152703/http://www.itref.ir/uploads/editor/1edad0.pdf - CMS Manual System. Pub 100-17 Medicare Business Partners. Department of Health & Human Services (DHHS) & Centers for Medicare & Medicaid Services (CMS). cms.gov. (2023).
Original: https://www.cms.gov/Research-Statistics-Data-and-Systems/CMS-Information-Technology/InformationSecurity/Downloads/Business-Partner-System-Security-Manual-BPSSM.pdf
Archived: https://web.archive.org/web/20230831124304/https://www.cms.gov/Research-Statistics-Data-and-Systems/CMS-Information-Technology/InformationSecurity/Downloads/Business-Partner-System-Security-Manual-BPSSM.pdf - Payment Card Organizations > PCI Security Standards Council. Unified Compliance. www.unifiedcompliance.com. (2023).
Original: https://www.unifiedcompliance.com/products/search-authority-documents/authority-document/1071
Archived: https://web.archive.org/web/20230831124324/https://www.unifiedcompliance.com/products/search-authority-documents/authority-document/1071/ - Disabling administrative shares breaks PsTools. undergroundwires/privacy.sexy. github.com. (2024).
Original: https://github.com/undergroundwires/privacy.sexy/issues/249
Archived: https://web.archive.org/web/20240510180222/https://github.com/undergroundwires/privacy.sexy/issues/249
Apply Now
Choose one of three ways to apply:
Download script
Download and run the script directly- No app needed
- Offline usage
- Easy-to-apply
- Free
- Open-source
Apply with privacy.sexy
Guided, automated application with safety checks- Recommended for most users
- Includes safety checks
- Free
- Open-source
- Popular
- Offline/Online usage
- Apply
- Revert
:: Set the registry value: "HKLM\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters!AutoShareWks"
PowerShell -ExecutionPolicy Unrestricted -Command "$registryPath = 'HKLM\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters'; $data = '0'; reg add 'HKLM\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters' /v 'AutoShareWks' /t 'REG_DWORD' /d "^""$data"^"" /f"
Ijo6IERlbGV0ZSB0aGUgcmVnaXN0cnkgdmFsdWUgXCJIS0xNXFxTWVNURU1cXEN1cnJlbnRDb250cm9sU2V0XFxTZXJ2aWNlc1xcTGFubWFuU2VydmVyXFxQYXJhbWV0ZXJzIUF1dG9TaGFyZVdrc1wiXG5Qb3dlclNoZWxsIC1FeGVjdXRpb25Qb2xpY3kgVW5yZXN0cmljdGVkIC1Db21tYW5kIFwicmVnIGRlbGV0ZSAnSEtMTVxcU1lTVEVNXFxDdXJyZW50Q29udHJvbFNldFxcU2VydmljZXNcXExhbm1hblNlcnZlclxcUGFyYW1ldGVycycgL3YgJ0F1dG9TaGFyZVdrcycgL2YgMj4kbnVsbFwiIg==
Similar Guides
Wider Goal
Guides below includes this guide to achieve a wider goal.See other more general settings that includes this one as one of its actions.
These plans combine multiple privacy settings, including this one, for stronger protection.
- Disable insecure remote administration access
- Improve network security
- Security improvements
This category improves security by disabling insecure remote administration features. Organizations use remote administration tools to manage multiple systems from...
This category is dedicated to improving network security. It aims to minimize vulnerabilities by offering various settings that improve the integrity and confident...
This category encompasses a range of scripts designed to improve the security of your system by enforcing security best practices. These scripts help protect your ...
Same Goal
Other guides in Disable insecure remote administration accessSee settings that are in the same category as this guide.
Using other actions in the same category may help you achieve your goal better.
See all 7 guides
About the Creators
These people have authored this documentation and written its scripts:
Reviewed By
This guide has undergone comprehensive auditing and peer review:Expert review by undergroundwires
- Verified technical accuracy and editorial standards
- Assessed system impact and user privacy risks
Public review by large community
- Privacy enthusiasts and professionals peer-reviewed
- Millions of end-users tested across different environments
History
We continually monitor our guides, their impact and all other privacy options. We update our guides when new information becomes available. On every update, we publicly store who made the change, what has been changed, why the change was made and when the change was made.