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