Disable Administrative Hidden Shares with Regedit
Administrative hidden shares, such as C$ and
ADMIN$, are automatically created by Windows on system boot
for remote administration. While useful in managed enterprise
environments, these default shares can present a security risk if left
exposed. This guide provides a straightforward method to permanently
disable the automatic creation of these hidden shares on system boot by
configuring the Windows Registry using Regedit.
Steps to Disable Hidden Administrative Shares
Follow these steps to modify the Windows Registry for either Windows client operating systems (Windows 10, 11) or Windows Server editions:
- Open Registry Editor
- Press
Win + Ron your keyboard to open the Run dialog. - Type
regeditand press Enter (or click OK). - Click Yes if prompted by User Account Control (UAC).
- Press
- Navigate to the Target Key
In the Registry Editor address bar, paste the following path and press Enter:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters
- Create or Modify the Appropriate DWORD Value
- For Windows Client OS (Windows 10 / Windows 11):
- Right-click on an empty space in the right pane, select New, and click DWORD (32-bit) Value.
- Name the new value
AutoShareWks(case-sensitive). - Double-click
AutoShareWks, set the Value data to0, and set the Base to Hexadecimal. Click OK.
- For Windows Server Editions:
- Right-click in the right pane, select New, and click DWORD (32-bit) Value.
- Name the new value
AutoShareServer(case-sensitive). - Double-click
AutoShareServer, set the Value data to0, and set the Base to Hexadecimal. Click OK.
- For Windows Client OS (Windows 10 / Windows 11):
- Apply the Changes
Close the Registry Editor.
Restart your computer, or restart the Server service using an elevated Command Prompt:
net stop server net start server
Verifying the Changes
To ensure the hidden shares have been successfully disabled:
- Open Command Prompt as Administrator.
- Type
net shareand press Enter. - Verify that administrative drive shares (such as
C$,D$) andADMIN$are no longer listed. (Note:IPC$is required for core system communication and may remain active).