Software & OS

How to Map a Network Drive in Windows 10 and 11

To map a network drive in Windows, open File Explorer, select This PC, choose More then Map network drive, pick a drive letter, type the share path as \\server\share and select Finish. The one-line command version is net use Z: \\server\share /persistent:yes.

The steps are the same on Windows 10 and Windows 11 apart from where the button sits. Replace server, share and Z: in every example below with your own values.

How to map a network drive in File Explorer

This is the method Microsoft documents for Windows 11:

  1. Open File Explorer (Windows key + E) and select This PC in the left pane.
  2. On the ribbon, select More, then Map network drive. If the entry is not on that menu, right-click This PC in the folder pane and choose it there.
  3. In the Drive list, choose a letter. Microsoft says any available letter works.
  4. In the Folder box, type the path of the folder or computer, or select Browse to pick it.
  5. Tick Reconnect at sign-in if you want the drive to be there every time you sign in.
  6. Select Finish.

On Windows 10, select This PC, then open the Computer tab and select Map network drive. Steps 3 to 6 are identical.

The drive then shows up under This PC with the letter you chose, and you open it like any local disk.

What to type in the Folder box

Windows uses UNC paths for network shares: two backslashes, the server name, one backslash, the share name.

You want to mapPath to type
A share on a computer or NAS by name\\nas01\photos
The same share by IP address\\192.168.1.20\photos
A folder inside a share\\nas01\photos\2026
A share with a space in its name (command line)"\\nas01\family photos"

If you do not know the share name, use Browse in the mapping window. If the computer does not show up in the browse list, turn on discovery first: see how to turn on network discovery in Windows.

The Microsoft support page does not describe a field for a different user name. If the share needs an account other than your Windows sign-in, Windows may ask for a user name and password when you connect. The command-line methods below let you give those credentials up front.

Map a network drive with net use

Open Command Prompt or PowerShell and run:

net use Z: \\nas01\photos

This is the pattern from Microsoft's net use reference, which maps a drive letter to a share. To connect as a different user, add /user. A domain name goes before the user name:

net use Z: \\nas01\photos /user:Accounts\User1

Windows then asks for the password. You can also put a password on the command line, but typing * in its place makes Windows prompt for it, and the password is not displayed as you type. Prefer the prompt: a password typed into the command is visible on screen and can be saved in your shell history.

Other switches worth knowing, all from the same reference:

  • * in place of the drive letter assigns the next available letter.
  • /savecred stores the credentials you give so they can be reused.
  • /persistent:yes saves the connection and restores it at the next logon. /persistent:no does not save it.
  • If the server name contains spaces, put quotation marks around the whole path, from the double backslash to the end. Without the quotes, an error message appears.

Run net use with no arguments to list your current connections. Example output (your entries will differ):

Status       Local     Remote                    Network

-------------------------------------------------------------------------------
OK           Z:        \\nas01\photos            Microsoft Windows Network
The command completed successfully.

Make the mapped drive permanent

Whether a drive returns after a restart depends on the persistent setting. Microsoft documents that the default for /persistent is "the setting used last", so a drive mapped right after a /persistent:no connection may not come back. Be explicit:

net use Z: \\nas01\photos /persistent:yes

In File Explorer, the equivalent is the Reconnect at sign-in checkbox. The reference also says deviceless connections, meaning connections made without a drive letter, are never persistent. If you need a connection to survive sign-out, give it a letter.

Map a network drive with PowerShell

The New-SmbMapping cmdlet from the SmbShare module creates the same kind of mapping. Microsoft's own example:

New-SmbMapping -LocalPath "X:" -RemotePath "\\Contoso-SO\VMFiles"

Example output, as shown in that documentation:

Status    Local Path    Remote Path
------    ----------    -----------
OK        X:            \\Contoso-SO\VMFiles

To keep it across sign-ins, add -Persistent $true. To use other credentials, pass -UserName and -Password, or -Credential with a credential object, which makes PowerShell prompt for the password. The -Credential route keeps the password out of your command history. Get-SmbMapping lists your mappings and Remove-SmbMapping removes one.

The cmdlet's documentation also lists switches that matter on managed networks: -RequireIntegrity requires SMB signing for the mapped drive, and -RequirePrivacy requires SMB encryption. Use them when you map a share over a network you do not control, and the server supports them.

How to disconnect a mapped drive

In File Explorer, right-click the drive under This PC and choose Disconnect. On the command line:

net use Z: /delete

Using * instead of a letter cancels all network connections. The reference adds one limit: you cannot disconnect from a shared directory while you are using it as your current drive or an active process is using it. Close the files and move out of the drive in your shell first. For persistent connections, /delete is also what removes them from the restore list.

If mapping fails

Microsoft's support page gives two reasons for a failed connection: the computer you are trying to reach might be turned off, or you might not have the correct permissions. Work through those in order.

  • Check the path. A typo in the server or share name is the cheapest thing to rule out. Try opening \\nas01\photos from the Run box (Windows key + R) before you map it.
  • Check the other computer. Confirm it is on, awake and on the same network. Try the IP address in place of the name: if that works, the problem is name resolution, not the share.
  • Check permissions. The share's owner needs to allow your account. Ask for access, or map with the right credentials using /user or -UserName.
  • Read the message. net use prints a numbered system error. Note the number and search for it in Microsoft's documentation instead of guessing.
  • Ask the administrator. On a work network, Microsoft's advice is to contact your network administrator, who may restrict which shares you can map.

Two cautions. Map only shares you trust, because a mapped drive behaves like a local disk and programs will open files from it. And if you use /savecred or a saved credential on a shared PC, anyone who signs in to your account can reach that share.

Frequently asked questions

What path do I type to map a network drive?
Use a UNC path in the form \\server\share, for example \\nas01\photos. The server can be a computer name or an IP address. Use the Browse button in the Map Network Drive window if you do not know the share name.
How do I make a mapped drive survive a restart?
In File Explorer, tick Reconnect at sign-in before you select Finish. On the command line, add /persistent:yes to net use, or -Persistent $true to New-SmbMapping. Without that setting, the drive may not come back at the next sign-in.
How do I disconnect a mapped network drive?
In File Explorer, right-click the drive under This PC and choose Disconnect. On the command line, run net use Z: /delete, where Z: is the drive letter. net use * /delete cancels all network connections.
Can I map a drive to a folder inside a share?
Yes. Put the folder after the share name, for example \\nas01\photos\2026. The Microsoft net use documentation shows the same pattern with a folder below the share.
Why can't I map a drive to a computer that is on my network?
Microsoft's guidance is that the target computer might be turned off, or you might not have the correct permissions on the share. Check that the other computer is on, that the share exists, and that your account is allowed to open it.

Sources