How to disable administrative shares from the command prompt. You must know and learn these command, normally windows automatically share certain folders over the network, like as C drive, C:\Windows & IPC$.
Now, used below command net share to delete the system/hidden shares.
net share sharedFolder /delete
You can run a separate command to delete each of the system shares.
net share C$ /delete net share IPC$ /delete net share ADMIN$ /delete
Example: (It’s showing below results)
C:\>net share Share name Resource Remark --------------------------------------------------------- C$ C:\ Default share IPC$ Remote IPC ADMIN$ C:\WINDOWS Remote Admin The command completed successfully.
You need to run the commands prompt to disable the shares.
c:\>net share C$ /delete C$ was deleted successfully. c:\>net share IPC$ /delete IPC$ was deleted successfully. c:\>net share ADMIN$ /delete ADMIN$ was deleted successfully. c:\>net share There are no entries in the list. c:\>
The alternative command prompt to delete system shares-
Now, need to use for loop, we just run the one command that iterates over all administrative shares and issues delete command.
for %i in (C$ IPC$ ADMIN$) do net share %i /delete
Registry Editor method:
Open “regedit” and navigate to “HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System.”
Create a DWORD value “LocalAccountTokenFilterPolicy” with a value of 1 to disable administrative shares.
Group Policy method:
Open “gpedit.msc” and go to “Computer Configuration > Administrative Templates > Network > Lanman Workstation.”
Enable “Enable Insecure Guest Logons” to disable administrative shares.
Remember to proceed with caution and understand the consequences before making changes.
You may also like: Permanently Disable Windows Defender Windows 10 PC