Often stuck with an orphaned shared folder? I did, many times. Moreover, when I go ahead and try to delete it, I am hit with an error message saying the share must be removed from the distributed file system before it can be deleted.
There is an easy way out:
Either find the registry entry for that DFS under HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\DFSRoots\Domain
and delete the key named with the DFS name.
OR
If you are in love with the command line like me, run the command
dfsutil /clean /server: /share:
The next step is to go to services and restart the service called “Server”. The “DFS Namespaces” service is dependent on it, so go ahead and accept the prompt that says this will restart DFS Namespaces.
Now go back to the share and remove it without any problems.