Unable to remove old share reference


zipeze

New member
Local time
11:34 PM
Posts
1
OS
Windows 11 Pro
I had a hard drive connected through USB in its own enclosure, and which had a shared a folder in it. I recently had plugged it into a different port, which deleted the network share for some reason, but re-sharing the folder again created a duplicate share that showed on other computers. The duplicate had a number appended to its name.

I figured out how to remove the old share using a command I found online then restarting, which then removed it from Computer Management > System Tools > Shared Folders > Shares, but the current (new) name stayed with the appended number which doesn't match the name of the folder.

I've read instructions to just right-click the share name then select "Stop Sharing", but that option isn't there for shared folders apparently, only shared drives. I don't want to share the whole drive, just the folder. I just want it named properly and pointing to the right place.

The new share is also removed from folder Properties > Share. It doesn't matter what I do there, it always brings back the incorrect name. I'm flummoxed at how unintuitive and difficult it is to just do a basic "remove" action in Windows shared folders.

I don't remember the exact command I used to remove the old share, but after rebooting, I found something like `net use \\PC1\DriveX2 /delete`, which just says "The network connection could not be found." even though the share of the exact same name (DriveX2) is in Computer Management. If I just do `net use DriveX2 /delete`, I get the same error.
 

My Computer

System One

  • OS
    Windows 11 Pro
    Computer type
    PC/Desktop
I've read instructions to just right-click the share name then select "Stop Sharing", but that option isn't there for shared folders apparently, only shared drives.

It should be there for shared folders also. It may be missing because the share is invalid, but generally, it's there for any shared path, whether a folder or drive.

The net use command does not remove shares. It connects and disconnects from existing shares. The command you want to manage the shares themselves is net share. You may be able to delete the share with net share The_Name_Of_The_Share /delete.

Failing that, and since you've already gone the Computer Management route, I would
  1. Take a system backup, because we're about to go poking around where people shouldn't be.
  2. Open an administrative PowerShell session, and type Stop-Service 'LanmanServer'.
  3. In the same PowerShell window, type regedit (so it runs with admin rights).
  4. Navigate to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanmanServer\Shares.
  5. In that key, you should see a value for the share you want to eliminate. Delete it.
  6. The Shares key should have a subkey called Security. Open that key, and do the same thing.
  7. Restart Windows.
 

My Computer

System One

  • OS
    Windows 11 Pro 24H2 [rev. 4351]
    Computer type
    PC/Desktop
    Manufacturer/Model
    Intel NUC12WSHi7
    CPU
    12th Gen Intel Core i7-1260P, 2100 MHz
    Motherboard
    NUC12WSBi7
    Memory
    64 GB
    Graphics Card(s)
    Intel Iris Xe
    Sound Card
    built-in Realtek HD audio
    Monitor(s) Displays
    Dell U3219Q
    Screen Resolution
    3840x2160 @ 60Hz
    Hard Drives
    Samsung SSD 990 PRO 1TB
    Keyboard
    CODE 104-Key Mechanical with Cherry MX Clears
    Antivirus
    Microsoft Defender

Latest Support Threads

Back
Top Bottom