/
/

Guide: How to Map a Network Drive in Windows

How to Map a Network Drive in Windows blog banner image

Efficient and secure sharing of data fosters productivity and collaboration among teams. That’s why having access to assets within the same network plays a vital role in streamlining workflows. Thankfully, Windows 11 allows network drive mapping, a process that assigns a drive letter to a shared folder on another computer or server within the same network.

Mapping a network drive creates a convenient, persistent link to remote resources for file access, backup, or collaborative workflows. If you’re wondering how to map a network drive in Windows , this guide covers all the essential steps.

Prerequisites for mapping a network drive

Before you start, here are some things you need to do first:

  1. Enable Network Discovery and File Sharing.
    • Navigate to Control Panel > Network and Sharing Center Change advanced sharing settings.
    • Turn on Network discovery and File and Printer sharing for the current profile.
  2. Obtain the network path of the shared folder.
    • You’ll need the Universal Naming Convention (UNC) path of the folder you want to map. This usually looks like this:
                                            \\ServerName\SharedFolder
  3. Check access credentials.
    • User credentials may be required if the target folder requires authentication. Ensure you have the correct username and password if Windows prompts you to enter these when mapping the drive.
  4. Check administrative rights.
    • While not always necessary, administrative privileges are recommended, especially when setting up mapped drives for multiple users or deploying via script.

Take a deeper look at how to set up shared folders before mapping drives.
→ Read our guide on how to share files and folders over a network

How to map a network drive

Here are the different methods and steps in mapping a network drive.

Method 1: Map a Network Drive via File Explorer (GUI)

  1. Press the Windows key + E to open File Explorer.
  2. In the left pane, click “This PC.”
  3. Click the three-dot menu at the top and select “Map network drive.”
  4. In the dialog box that appears:
    • Choose a drive letter (e.g., Z:).
    • Enter the folder path, (e.g., \\Server\SharedFolder).
    • Optionally, check “Reconnect at sign-in” to make it persistent.
    • Optionally, check “Connect using different credentials” if needed.
  5. Click Finish. If prompted, enter your credentials and save them.

The mapped drive should appear under This PC for easy access.

Method 2: Map a network drive via Command Prompt

  1. Open the Command Prompt as an administrator.
  2. Run the following command: net use Z: \\ServerName\SharedFolder /persistent:yes
  3. Replace Z: with your preferred drive letter.
  4. Replace the UNC path accordingly.
  5. Use /persistent:no if you don’t want the drive to reconnect at login.
  6. Press Enter. Enter your username and password when prompted.

To remove a mapped drive, run the command net use Z: /delete, which will delete it from the system.

Method 3: Map a Network Drive via PowerShell

PowerShell is especially useful when included in automation scripts or configuration management tools.

  1. Open PowerShell or Windows Terminal as Administrator.
  2. Run the New-PSDrive command:
    • New-PSDrive -Name “Z” -PSProvider FileSystem -Root “\\ServerName\SharedFolder” -Persist
    • “Z” is the drive letter.
  3. Replace the UNC path with your shared folder location.
  4. The -Persist flag ensures the drive remains mapped after a reboot and appears in File Explorer.

To remove a mapped drive, run the command Remove-PSDrive -Name “Z”. The -Persist flag ensures the drive is visible in File Explorer and survives a reboot.

Enterprise considerations (Login Script or GPO)

In enterprise environments, it’s often necessary to map drives automatically for users across multiple machines. Two common methods include logon scripts and Group Policy Preferences.

Using a logon script

You can write a CMD or PowerShell script to map drives at user login.

  • Example CMD script: net use X: \\Server\DepartmentShare /persistent:yes
  • Example PowerShell script: New-PSDrive -Name “X” -PSProvider FileSystem -Root “\\Server\DepartmentShare” -Persist

Deploy this script via:

  • Group Policy: Navigate to User Configuration > Windows Settings > Scripts (Logon/Logoff).
  • Microsoft Intune: Use the PowerShell script deployment method.

Using Group Policy Preferences

Group Policy Preferences offer a powerful way to manage drive mappings across an entire organization with minimal manual intervention.

  1. Open Group Policy Management Editor.
  2. Go to: User Configuration > Preferences > Windows Settings > Drive Maps
  3. Right-click and choose New > Mapped Drive.
  4. Configure:
    • Drive letter (e.g., X:)
    • Location (e.g., \\Server\DepartmentShare)
    • Visibility and label
  5. Apply filters to target specific users or groups as needed.

Why map a network drive?

Mapping a network drive benefits many users in several ways, including:

  • Access to shared folders using a consistent drive letter.
  • Simplification of navigation to frequently used network locations.
  • Enablement of automation and centralized data storage for users.
  • Support for enterprise-wide drive mapping through login scripts or group policies.

Troubleshooting tips for network drive mapping

You may encounter issues despite following the correct instructions for network drive mapping. Here are some of the most common problems you may come across and how to potentially solve them:

“Network path not found” error

When you receive this error, it can be related to situations where the shared folder’s server or computer is offline, disconnected, or the path is incorrect.

Here’s what you can do:

  • Ensure the host computer is online and accessible, and connected to the network.
  • Look into the UNC path and see if the problem originates there. Ensure that you’re referencing the correct network location in the proper format.

”Access denied” error

Encountering this issue may mean that you don’t have the required permission to access the shared folder.

Here’s how you can potentially resolve the problem:

  • Verify that your credentials, such as username and password, are correct.
  • Make sure you have appropriate share and NTFS permissions.

Drive doesn’t reconnect

In some instances, you may notice that the drive doesn’t reconnect after rebooting your PC.

Here’s what you can do:

  • Confirm that the persistent option is enabled.
  • Ensure /persistent:yes is used, or Reconnect at sign-in is checked.

Mapped drive not visible in File Explorer

There are times when the drive is mapped but doesn’t show up immediately in the system.

Here’s how to mitigate the situation:

  1. Try restarting the File Explorer process via Task Manager.
    • Open Task Manager and go to the Processes tab.
    • Find Windows Explorer.
    • Right-click Windows Explorer and click Restart.
  2.  You can also try signing out and signing in again to refresh the user session.

Reduce time spent on repetitive IT tasks like drive mapping with automation.
→ Automate repetitive tasks or learn more about NinjaOne Automation

Streamline network drive mapping

Mapping network drives in Windows 11 offers a reliable and flexible way to access shared network resources, whether you’re working individually or managing an enterprise environment. You can use File Explorer for quick manual mapping, Command Prompt or PowerShell for scripting and automation, and Group Policy or logon scripts for large-scale deployments. No matter the method, always ensure the network location is available and that proper permissions are in place.

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).