How to map network drive on Windows 11

Windows 11 gives you several ways to map network drives, whether you prefer a graphical interface or command-line tools.

Windows 11 map network drive / Image: Mauro Huculak
Windows 11 map network drive / Image: Mauro Huculak
  • Windows 11 lets you map network drives using File Explorer, Command Prompt, or PowerShell.
  • A mapped drive makes a shared network folder accessible from File Explorer like a local drive.
  • You can use net use or Remove-PSDrive to disconnect mapped network drives from the command line.
  • File Explorer provides the simplest way to map or disconnect a network drive without commands

On Windows 11, you can map a network drive in several ways, including using File Explorer, PowerShell, and Command Prompt. Mapping a drive makes it easier to access a shared folder on your network as if it were local.

Once configured, the network location appears under “Network locations” in the “This PC” section of File Explorer, allowing you to access shared files without navigating to the network path each time.

Windows 11 also provides several ways to disconnect a mapped drive when you no longer need it, including using the same tools you used to create it.

In this guide, I’ll show you how to map a network drive on Windows 11 and disconnect it when you no longer need it.

Map network drive on Windows 11

On Windows 11 Pro and Home, you have multiple ways to map a network folder to your computer, and here’s how.

Map a network drive using File Explorer

To map a network drive with File Explorer on Windows 11, use these steps:

  1. Open File Explorer on Windows 11.

  2. Click on This PC from the left pane.

  3. Click the See more (three dots) button in the command bar and select the “Map network drive” option.

    File Explorer map network drive option

  4. Choose a letter to assign the drive from the “Drive” drop-down menu.

  5. Confirm the network path to the shared folder in the “Folder” setting. (You can also click the Browse button to browse the folder to map as a network drive and click the OK button.)

    Windows 11 map network drive

  6. Check the “Reconnect at sign-in” option to make the connection permanent.

  7. Check the “Connect using different credentials” option if the credentials differ from the account you already use on Windows 11.

  8. Click the Finish button.

  9. Confirm the network account credentials (if applicable).

  10. Click the OK button.

After you complete the steps, the network drive will appear in File Explorer.

Get the Pureinfotech newsletter

Expert Windows guides, practical tips, and the latest updates that make your PC easier to use, delivered to your inbox

If you cannot connect to the network drive, use the IP address instead of the computer name. However, if the remote device uses a dynamic IP address configuration, it may change in the future, and you may need to reconnect.

Also, if the device providing the resources uses a Microsoft account with the passwordless option, you will need to create a local account on that device to connect. Otherwise, the mapping won’t work.

Map a network drive using Command Prompt (net use)

To map a network drive through Command Prompt on Windows 11, use these steps:

  1. Open Start.

  2. Search for Command Prompt and click the top result to open the console. 

    Quick tip: You don’t have to run the command console as an administrator. If you do, the mapped network drive will not show in File Explorer.
  3. Type the following command to map a drive, assigning a drive letter manually, and press Enter:

    net use Z: \\DEVICE-NAME-OR-IP\SHARED-FOLDER

    In the command, replace “Z” with a drive letter that hasn’t already been used. Then, replace “DEVICE-NAME-OR-IP” and “SHARED-FOLDER” with the computer name or IP address of the device hosting the shared folder and the name of the share. For example, this command maps the ShareFiles folder to the computer with the “Z” drive letter:

    net use Z: \\COMPUTER\ShareFiles

    Command Prompt map network drive

  4. Type the following command to map a drive, assigning the drive letter automatically, and press Enter:

    net use * \\DEVICE-NAME-OR-IP\SHARED-FOLDER

    In the command, the (*) option automatically assigns a randomly available drive letter. Then, replace “DEVICE-NAME-OR-IP” and “SHARED-FOLDER” with the computer name or IP address of the device hosting the shared folder and the name of the share. For example, this command maps the ShareOne folder to the computer:

    net use * \\COMPUTER\ShareFiles

    Command Prompt map network drive automatic letter

  5. Type the following command to map a drive, providing authentication details, and press Enter:

    net use Z: \\DEVICE-NAME-OR-IP\SHARED-FOLDER PASSWORD /user:USERNAME /persistent:yes

    In the command, replace “Z” with a drive letter that isn’t already in use. Then, change “DEVICE-NAME-OR-IP” and “SHARED-FOLDER” to the computer name or IP address of the device hosting the shared folder and the name of the share. Replace “PASSWORD” and “USERNAME” with the credentials needed to authenticate to the remote machine. The “persistent” option allows the folder to stay mapped after reboot. For example, this command maps the ShareFiles folder, providing the user credentials and making the mapping persistent:

    net use Z: \\COMPUTER\ShareFiles password /user:admin /persistent:yes

    Command Prompt map network drive with password

After you complete the steps, the network shared folder will map in Windows 11 and appear in File Explorer.

Map a network drive using PowerShell (New-PSDrive)

To map a network drive with PowerShell commands, use these steps:

  1. Open Start.

  2. Search for PowerShell and click the top result to open the console.

    Quick tip: You don’t have to run the command console as an administrator. If you do, the mapped network drive will not show in File Explorer.
  3. Type the following command to map the network drive, assigninga  letter manually, and press Enter:

    New-PSDrive -Name "DRIVER-LETTER" -PSProvider "FileSystem" -Root "\\DEVICE-NAME-OR-IP\SHARED-FOLDER" -Persist

    In the command, replace “DRIVER-LETTER” with a drive letter that has not already been used. Then, change “DEVICE-NAME-OR-IP” and “SHARED-FOLDER” to the computer name or IP address of the computer hosting the shared folder and the name of the share. For example, this command maps the ShareFiles folder to the computer with the “Z” drive letter:

    New-PSDrive -Name "Z" -PSProvider "FileSystem" -Root "\\COMPUTER\ShareFiles" -Persist

    PowerShell map network drive

Once you complete the steps, the shared folder will mount as a network drive on the computer and appear on File Explorer.

Map a network drive with credentials in PowerShell

To map a network drive providing the account name and password, use these steps:

  1. Open Start.

  2. Search for PowerShell and click the top result to open the console.

  3. Type the following command to create a variable to store the account information and press Enter:

    $cred = Get-Credential -Credential USERNAME

    PowerShell store password in variable

    Quick tip: If you are mapping a drive in Active Directory, specify the user name like this: network\admin.
  4. Confirm the account password.

  5. Click the OK button.

  6. Type the following command to map a drive assigning drive letter manually and press Enter:

    New-PSDrive -Name "E" -Root "\\DEVICE-NAME-OR-IP\SHARED-FOLDER" -Persist -PSProvider "FileSystem" -Credential $cred

    In the command, replace “DRIVER-LETTER” with the drive letter that has not already been used. Then, change “DEVICE-NAME-OR-IP” and “SHARED-FOLDER” to the computer name or IP address of the device hosting the shared folder and the name of the share. For example, this command maps the “ShareFiles” folder to the computer with the “X” drive letter:

    New-PSDrive -Name "X" -Root "\\COMPUTER\ShareFiles" -Persist -PSProvider "FileSystem" -Credential $cred

    PowerShell map drive with password

Once you complete the steps, the command will map the shared folder with your specified credentials.

When you connect using credentials, you will always be prompted to enter a password manually. To avoid this step, you can store the password in an encrypted file on the computer and query it using PowerShell. Or you can speed up the process by holding the remote host account name and password in “Credential Manager” and then using the same command without the -Crendtial option like this: New-PSDrive -Name "E" -Root "\\vm-beta\ShareOne" -Persist -PSProvider "FileSystem"

You can create a new entry in Credential Manager using this command: cmdkey /add:pcname /user:network\username /pass:password

Disconnect network drive on Windows 11

You also have different methods to disconnect a network drive. However, it’s best to disconnect the drive the same way you connected it.

Disconnect a network drive from File Explorer

To disconnect a network drive on Windows 11, use these steps:

  1. Open File Explorer.

  2. Click on This PC from the left pane.

  3. Right-click the network drive (select See more options) and choose the Disconnect option under the “Network Locations” section.

    File Explorer disconnect network drive

After you complete the steps, the network drive will no longer be available on the computer.

Disconnect a mapped drive using Command Prompt

To disconnect a network drive on Windows 11 with Command Prompt, use these steps:

  1. Open Start.

  2. Search for Command Prompt and click the top result to open the console.

  3. Type the following command to disconnect a mapped network drive and press Enter:

    net use z: /Delete
    

    Command Prompt disconnect network drive

    In the command, replace “Z” with the drive letter of the mapped drive you want to remove.

  4. (Optional) Type the following command to disconnect all the mapped network drives and press Enter:

    net use * /Delete
    

After you complete the steps, the mapped drives will disconnect and no longer be accessible from File Explorer.

Disconnect a network drive using PowerShell

To disconnect and remove a mapped network drive with PowerShell on Windows 11, use these steps:

  1. Open Start.

  2. Search for PowerShell and click the top result to open the console.

  3. Type the following command to view all the mapped drives and press Enter:

    Get-PSDrive -PSProvider "FileSystem"
  4. Type the following command to disconnect the mapped network drive and press Enter:

    Remove-PSDrive -Name DRIVE-LETTER

    In the command, replace DRIVE-LETTER with the drive letter of the mapping. For example, this command disconnects the “X” drive:

    Remove-PSDrive -Name X

    PowerShell disconnect network drive

  5. (Optional) Type the following command to disconnect multiple mappings and press Enter:

    Get-PSDrive DRIVER-LETTER-1, DRIVE-LETTER-2 | Remove-PSDrive

    In the command, replace “DRIVER-LETTER-1” and “DRIVE-LETTER-2” with the drive letters you want to disconnect. For example, this command disconnects the “E” and “F” drives:

    Get-PSDrive E, F | Remove-PSDrive

Once you complete the steps, the network mapping will no longer be available on the computer.

What method did you use to add the network drive on Windows 11? If you have any questions, let me know in the comments.

FAQs about mapping a network drive on Windows 11

Here’s a list of frequently asked questions (FAQs) and answers about connecting a network drive on Windows 11.

Why don’t mapped drives appear in File Explorer when mapped with net use or PowerShell?

Mapped drives don’t appear in File Explorer if they were created in a different security context, like an elevated (admin) Command Prompt or PowerShell. File Explorer runs unelevated and won’t see drives mapped from an elevated session.

Why isn’t a drive mapped with New-SMBMapping visible in File Explorer?

New-SMBMapping often creates a session-only mapping that Explorer doesn’t immediately recognize. Restarting Explorer usually fixes it. For a persistent mapping that shows up reliably, use New-PSDrive -Persist.

Why do I get “Access Denied” when mapping a drive in a PowerShell remoting session?

Windows 11 may block remote drive mapping unless the New-PSDrive command is executed directly within the Invoke-Command block. This forces the remote system to apply credentials locally.

Why do mapped drives disconnect after reboot or intermittently?

This is a common Windows 11 issue. The most effective fix is using persistent flags when mapping: net use M: \\server\share /savecred /persistent:yes. Also, check and refresh any outdated Credential Manager entries.

How can I delete a mapped drive when the “Disconnect” option is missing?

Try restarting File Explorer via Task Manager to refresh the drive list. If that fails, manually delete the mapping’s Registry entry under HKEY_CURRENT_USER\Network.

How do I completely remove a ghosted drive letter after disconnecting?

First, run net use X: /delete. If the letter persists, remove its Registry key from HKEY_CURRENT_USER\Network, then restart File Explorer.

Should I use an IP address or device name for mapping shared folders?

Using the IP address generally offers more reliable and faster connections, as it bypasses potential DNS or NetBIOS name resolution issues. If using an IP address, ensure the device has a static IP or a DHCP configuration.

Why is a local account often required instead of a Microsoft account for mapping?

SMB authentication often requires a local username and password matching a local security principal, which can conflict with modern passwordless or cloud-linked Microsoft accounts. Using a local account on the device hosting the share ensures reliable authentication.

Thank you for your feedback!
About the author

Mauro Huculak is a Windows How-To Expert and founder of Pureinfotech in 2010. With over 23 years as a technology writer and IT Specialist, Mauro specializes in Windows, software, and cross-platform systems such as Linux, Android, and macOS.

Certifications: Microsoft Certified Solutions Associate (MCSA), Cisco Certified Network Professional (CCNP), VMware Certified Professional (VCP), and CompTIA A+ and Network+.

Mauro is a recognized Microsoft MVP and has also been a long-time contributor to Windows Central.

You can follow him on YouTube, Threads, BlueSky, X (Twitter), LinkedIn and About.me. Email him at [email protected].

Comments

Join In