Windows automatically shares certain folders over the network, examples being C drive, C:\Windows & IPC$. Learn how to disable these administrative shares from command prompt.
Execute the below net share command to delete the system/hidden shares.
net share sharedFolder /delete
So to delete each of the system shares, we can run a separate command
net share C$ /delete net share IPC$ /delete net share ADMIN$ /delete
Example:
C:\>net share Share name Resource Remark --------------------------------------------------------- C$ C:\ Default share IPC$ Remote IPC ADMIN$ C:\WINDOWS Remote Admin The command completed successfully.
Now run the commands 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:\>
Alternative command to delete system shares
Using for loop, we can run just one command that iterates over all administrative shares and issues delete command.
for %i in (C$ IPC$ ADMIN$) do net share %i /delete
This is a useful feature to prevent viruses running around the network. If you are a home user, it’s always better to use a single PC and transfer files through Wi-Fi after scanning. Easy to use commands.
or you can stop server service ; net stop LanmanServer
Instead of entering commands separately, i think we can use && between each commands?
Technically true, and truly technical- to the point of irrelevance. Pawel above has the right idea – unless you dance the SAMBA, disable LanmanServer. (Who uses samba these days anyway?) Hell, I disable “server” and “workstation” services, windows ‘error’ reporting, bluetooth, etc. etc.
I got the following error whilst executing one of the commands:
“net share IPC$ /delete
System error 5 has occurred.
Access is denied.”
How can I fix this?