How to remove a Windows share when the folder does not exist anymore?
Shares are listed in HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanmanServer\Shares
registry key, you can delete the entries there, after a backup of the key (source)
If you know the source folder you may just recreate it and use the GUI functions for Sharing in Windows explorer