How to Delete a Network Share on Windows 10 and Windows 11

How to Delete a Network Share on Windows 10 and Windows 11 blog banner image

This guide demonstrates how to delete a network share on Windows 10 and Windows 11 with step-by-step instructions for removing mapped network drives. It explains several methods, additional tools, and how to troubleshoot network share deletion.

What are Windows network shares

A network share allows access to files and folders between computers over a local network or VPN. Network shares are commonly used in business and education environments to share files between users for collaboration and to keep them stored in a safe, controlled (and backed up) location. They are also increasingly common at home when connected to VPNs for remote work or sharing media with smart devices.

On Windows, it is common practice to permanently assign a network share to a local drive letter so that it’s always available in Windows Explorer. By doing this, the network share can be accessed just like your regular hard drive or a plugged-in USB stick using a drive letter (for example, instead of having to go to the network location \serverpathtoshare you can just navigate to the share mapped to the Z: drive). This is known as mapping a network drive. This saves the time and hassle of having to manually navigate to the network share (or type it in).

However, sometimes these shares can get disconnected or are no longer required: the location of a share may change, you may no longer have permission to access it, or you simply may no longer need to use the files on it. In some instances, shares are created on a Windows machine with the files on an external device that is later removed, but the share remains present (but unavailable).

Even when the share that was mapped to a network drive has been deleted, the mapped network drive needs to be manually removed.

Manage Windows endpoint with the #1-rated Windows RMM solution by G2.

Get started with NinjaOne Windows RMM.

Step-by-step guide to deleting network shares

To remove a network share on Windows, follow the relevant instructions below. If these basic instructions do not work for you, follow on for further troubleshooting steps using the Command Line.

How to delete network share mapping in Windows 11

The process to delete a network share that is mapped to a drive letter on Windows 11 is as follows:

  • Open the File Explorer (you can always find it by right-clicking on the Start button).
  • Click on This PC in the left navigation pane.
  • Under Network locationsRight-click on the mapped network share that you want to remove.
  • Click Disconnect.

How to delete network share mapping in Windows 11

This will remove the mapped shared drive, freeing up the drive letter for use. To restore the network drive, you will need to navigate back to its network address and re-map it.

How to delete network share mapping in Windows 10

The steps to remove a network share on Windows 10 that is mapped to a drive in Explorer is identical to Windows 11.

Deleting mapped network shares from the Command Prompt

To delete Windows shares that you’ve mapped to a network drive, use the net use command:

net use DRIVE_LETTER: /delete

Replace DRIVE_LETTER with the mapped network drive letter you want to delete (note that you also need to include the colon symbol).

For example, to delete a mapped network drive at the location Z:, run the following command:

net use Z: /delete

Deleting mapped network shares from PowerShell

To delete a mapped network drive in PowerShell, use the Remove-PSDrive cmdlet with the following syntax:

Remove-PSDrive -Name DRIVE_LETTER

Unlike net use, you don’t include the colon with the drive letter when running this command. For example, to delete the Z drive network share mapping, you would run:

Remove-PSDrive -Name Z

Deleting network share shortcuts

If you have a shortcut to network share on your Desktop or pinned to Quick access in Windows Explorer, you can simply right-click to delete it as you would any other shortcut.

Troubleshoot network share deletion

If a mapped share does not disappear after deletion, try running Command Prompt or PowerShell as Administrator to remove it. To do this, right-click on the Start menu and open the Command Prompt or PowerShell as Admin, and then run the above commands.

A network share that has had its drive mapping removed will no longer appear in Explorer under This PC. Once you delete a mapped network share on Windows, any shortcuts you have created to files or folders on it will stop working.

Deleting a mapped network drive does not delete the files on it, it’s just removing the reference to it. Deleting files stored in a network share does delete them from the share, possibly permanently. A robust backup solution will protect you from accidental data loss if you are sharing files among multiple users.

🥷 NinjaOne offers automated, centralized, and reliable data protection.

Learn more about NinjaOne Windows Endpoint Backup.

Efficiently managing and securing Windows Shares at scale

If you are managing network shares and drive mappings for a fleet of devices, it’s important that both access is controlled and files are kept secure.

Users should only have access to the files they require, to prevent sensitive information from being over-shared or leaked. Implementing permissions across your network also prevents users from accidentally interfering with the work of others. In addition to this, you should take advantage of the centralized nature of file shares in order to back up all the vital data and ongoing work for your organization.

NinjaOne provides a unified remote monitoring and management that automates and streamlines your IT operations, granting you visibility over your entire IT portfolio and ensuring that security policies are deployed and enforced.

Next Steps

For MSPs, their choice of RMM is critical to their business success. The core promise of an RMM is to deliver automation, efficiency, and scale so the MSP can grow profitably. NinjaOne has been rated the #1 RMM for 3+ years in a row because of our ability to deliver an a fast, easy-to-use, and powerful platform for MSPs of all sizes.
Learn more about NinjaOne, check out a live tour, or start your free trial of the NinjaOne platform.

You might also like

Ready to simplify the hardest parts of IT?
×

See NinjaOne in action!

By submitting this form, I accept NinjaOne's privacy policy.

NinjaOne Terms & Conditions

By clicking the “I Accept” button below, you indicate your acceptance of the following legal terms as well as our Terms of Use:

  • Ownership Rights: NinjaOne owns and will continue to own all right, title, and interest in and to the script (including the copyright). NinjaOne is giving you a limited license to use the script in accordance with these legal terms.
  • Use Limitation: You may only use the script for your legitimate personal or internal business purposes, and you may not share the script with another party.
  • Republication Prohibition: Under no circumstances are you permitted to re-publish the script in any script library belonging to or under the control of any other software provider.
  • Warranty Disclaimer: The script is provided “as is” and “as available”, without warranty of any kind. NinjaOne makes no promise or guarantee that the script will be free from defects or that it will meet your specific needs or expectations.
  • Assumption of Risk: Your use of the script is at your own risk. You acknowledge that there are certain inherent risks in using the script, and you understand and assume each of those risks.
  • Waiver and Release: You will not hold NinjaOne responsible for any adverse or unintended consequences resulting from your use of the script, and you waive any legal or equitable rights or remedies you may have against NinjaOne relating to your use of the script.
  • EULA: If you are a NinjaOne customer, your use of the script is subject to the End User License Agreement applicable to you (EULA).