Disable C$ and ADMIN$ Shares Using Regedit
Windows automatically creates hidden administrative shares, such as
C$ and ADMIN$, for remote management and
troubleshooting across a local network. While useful in enterprise
environments, leaving these default shares active can pose a security
risk on non-managed networks. This guide explains how to permanently
disable administrative shares in Windows by configuring the system
registry via the Registry Editor (regedit).
Step 1: Open the Registry Editor
- Press
Win + Ron your keyboard to open the Run dialog box. - Type
regeditand press Enter (or click OK). - If prompted by User Account Control (UAC), click Yes to grant administrative permissions.
Step 2: Navigate to the LanmanServer Key
In the Registry Editor, use the left-hand navigation pane to browse to the following path:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters
Step 3: Create and Configure the Registry Value
Depending on whether you are running a Windows client edition (Windows 10 or 11) or Windows Server, create the appropriate DWORD value:
For Windows 10 / Windows 11 (Workstation)
- Right-click on an empty area in the right pane.
- Select New > DWORD (32-bit) Value.
- Name the new value
AutoShareWks. - Double-click
AutoShareWks, set the Value data to0, and ensure the Base is set to Hexadecimal. - Click OK.
For Windows Server
- Right-click on an empty area in the right pane.
- Select New > DWORD (32-bit) Value.
- Name the new value
AutoShareServer. - Double-click
AutoShareServer, set the Value data to0, and ensure the Base is set to Hexadecimal. - Click OK.
Step 4: Apply Changes
To apply the changes, the Server service must be restarted, or the computer must be rebooted.
Option A: Restart via Command Prompt (Admin)
Run the following commands in an elevated Command Prompt:
net stop server
net start serverOption B: Restart the Computer
Restart your PC or server normally to ensure all administrative shares are removed.
Step 5: Verify the Changes
To verify that the administrative shares have been disabled:
Open Command Prompt.
Type the following command and press Enter:
net shareCheck the list of active shares. Administrative shares such as
C$,D$, andADMIN$should no longer be listed (theIPC$share may remain active as it is required for local system operations).