Security

Delete shared folders from terminal

> Run a command line instance with administrative privileges
> Execute the following command to list all non-hidden shared folders:

net share

> Execute the following command to delete a shared folder:

net share shared_folder_name /delete

How to delete all default hidden shared folders:
https://gist.github.com/maldevel/4f550f85d2ec147bf49e

@echo off
 
net share /delete C$ /y
net share /delete D$ /y
net share /delete E$ /y
net share /delete F$ /y
net share /delete G$ /y
net share /delete H$ /y
net share /delete I$ /y
net share /delete J$ /y
net share /delete K$ /y
net share /delete L$ /y
net share /delete M$ /y
net share /delete N$ /y
net share /delete O$ /y
net share /delete P$ /y
net share /delete Q$ /y
net share /delete R$ /y
net share /delete S$ /y
net share /delete T$ /y
net share /delete U$ /y
net share /delete V$ /y
net share /delete W$ /y
net share /delete X$ /y
net share /delete Y$ /y
net share /delete Z$ /y
 
net share /delete IPC$ /y
net share /delete $NT /y
net share /delete ADMIN$ /y
net share /delete $RPC /y
net share /delete print$ /y
 
net share /delete $RA SERVER /y
net share /delete $SQL SERVER /y
net share /delete lwc$ /y
 
@echo on