How to Map Network Drive or Disconnect Network Drive in Windows 10
When you map a network drive, you are creating a shortcut in This PC to a drive (ex: NAS), shared folder, or computer on your network. A mapped network drive has the following characteristics:
- It has a drive letter assigned like any other partition in your system.
- It points to a network shared folder on another PC.
- It points only to resources found on your network.
- You need the username and password credentials to connect to it.
This tutorial will show you different ways on how to map network drives or disconnect network drives for only your account in Windows 10.
See also:
- KB4471218 Mapped network drives don't work in Windows 10, version 1809 | Microsoft Support
- How To Map a WD Network Drive on Windows 10 | WD Support
Mapped network drives are stored in the registry locations below:
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\MountPoints2\<share name>
HKEY_CURRENT_USER\Network\<Drive letter>
The credentials used for your mapped network drives are stored in Credential Manager.
Contents
- Option One: To Map Network Drive in This PC
- Option Two: To Map Network Drive in Command Prompt
- Option Three: To Map Network Drive in PowerShell
- Option Four: To Disconnect Network Drive in This PC
- Option Five: To Disconnect Network Drive in Command Prompt
EXAMPLE: Mapped network drive in This PC
1 Do step 2, step 3, or step 4 below for how you would like to map a network drive in This PC.
2 Open This PC in File Explorer, click/tap on the Computer tab, click/tap on the Map network drive button in the ribbon, and go to step 5 below. (see screenshot below)
3 Open File Explorer, right click or press and hold on This PC in the navigation pane, click/tap on Map network drive, and go to step 5 below. (see screenshot below)
4 Open This PC in File Explorer, click/tap on the Computer tab, click/tap on Map network drive menu arrow in the ribbon, click/tap on Map network drive, and go to step 5 below. (see screenshot below)
5 You will now need to fill out the Map Network Drive wizard for what you want, and click/tap on Finished when done. (see screenshots below)
- Select an unused drive letter you want to assign to the network drive.
- Browse to and select, or type in the path, of the shared network folder. If typing the network path, you must start with “\\” followed by the name of the computer that is sharing the folder you want to map, followed by “\” and the name of the shared network folder.
- Check or uncheck to automatically Reconnect at sign-in to the mapped network drive.
- Check or uncheck Connect using different credentials to the mapped network drive depending on if the credentials for the network drive are already stored in Credential Manager from previously mapping the network drive, and if the credentials in Credential Manager are correct.
6 If you checked Connect using different credentials, you will now need to enter the user name and password credentials to connect to the network drive, and click/tap on OK. (see screenshot below)
If you did not check Connect using different credentials, Windows will try to connect to the network drive using the user account details from your computer in Credential Manager.
You can check the Remember my credentials box to not have to enter credentials each time you open the mapped network drive.
7 The mapped network drive will now automatically open. (see screenshot below)
For more details about the net use command, see: Net use - Microsoft Docs
1 Open a command prompt.
2 Type the command below you wanted to use into the command prompt, and press Enter. (see screenshot below)3 When finished, you can close the command prompt if you like.
(Remains connected after next logon)
net use <drive letter>: \\ComputerName\ShareName /user:UserName Password /persistent:yes
OR
(Removed after next logon)
net use <drive letter>: \\ComputerName\ShareName /user:UserName Password /persistent:no
Substitute <drive letter>: in the command above with an unused drive letter (ex: "Z:" ) you want to assign the mapped network drive.
If you like, you can substitute <drive letter>: in the command above with an asterisk * instead to have Windows automatically assign an unused drive letter to the mapped network drive.
Substitute ComputerName in the command above with the actual computer name of the PC (ex: "readyshare") that the shared folder is located on.
Substitute ShareName in the command above with the actual name of the network share folder (ex: "USB_Storage").
Substitute UserName in the command above with the actual user name (ex: "UserName") for the credentials of the shared folder.
Substitute Password in the command above with the actual password (ex: "password") for the credentials of the shared folder.
For example:
net use Z: \\readyshare\USB_Storage /user:UserName password /persistent:yes
OR
net use * \\readyshare\USB_Storage /user:UserName password /persistent:yes
For more details about the New-PSDrive command, see: New-PSDrive - Microsoft Docs
1 Open PowerShell.
2 Type the command below you wanted to use into PowerShell, and press Enter. (see screenshot below step 4)3 Enter the password of the shared folder's credentials, and click/tap on OK. (see screenshot below)
(Remains connected after next logon)
New-PSDrive -Name <drive letter> -PSProvider FileSystem -Root "\\ComputerName\ShareName" -Credential "UserName" -Persist
OR
(Removed after next logon)
New-PSDrive -Name <drive letter> -PSProvider FileSystem -Root "\\ComputerName\ShareName" -Credential "UserName"
Substitute <drive letter>: in the command above with an unused drive letter (ex: "Z:" ) you want to assign the mapped network drive.
Substitute ComputerName in the command above with the actual computer name of the PC (ex: "readyshare") that the shared folder is located on.
Substitute ShareName in the command above with the actual name of the network share folder (ex: "USB_Storage").
Substitute UserName in the command above with the actual user name (ex: "UserName") for the credentials of the shared folder.
For example:
New-PSDrive -Name Z -PSProvider FileSystem -Root "\\readyshare\MyBook2" -Credential "admin" -Persist
OR
New-PSDrive -Name Z -PSProvider FileSystem -Root "\\readyshare\MyBook2" -Credential "admin"
4 When finished, you can close PowerShell if you like.
1 Do step 2, step 3, step 4, or step 5 below for how you would like to disconnect a network drive in This PC.
2 Open This PC in File Explorer, right click or press and hold on the mapped network drive (ex: Z: ), click/tap on Disconnect, and go to step 7 below. (see screenshot below)
3 Open This PC in File Explorer, select the mapped network drive (ex: Z: ), click/tap on the Computer tab, click/tap on Map network drive menu arrow in the ribbon, click/tap on Disconnect network drive, and go to step 7 below. (see screenshot below)
4 Open File Explorer, right click or press and hold on This PC in the navigation pane, click/tap on Disconnect network drive, and go to step 6 below. (see screenshot below)
5 Open This PC in File Explorer, click/tap on the Computer tab, click/tap on Map network drive menu arrow in the ribbon, click/tap on Disconnect network drive, and go to step 6 below. (see screenshot below)
6 Select the mapped network drive(s) (ex: Z: ) you want to disconnect, click/tap on OK, and go to step 7 below. (see screenshot below)
7 The mapped network drive(s) have now been disconnected.
For more details about the net use command, see: Net use - Microsoft Docs
1 Open a command prompt.
2 Typenet use
into the command prompt, and press Enter to see a list of all your mapped network drives. (see screenshot below)
3 Type the command you want to use below into the command prompt, and press Enter. (see screenshot below)4 When finished, you can close the command prompt if you like.
(Disconnect a single specific mapped network drive)
net use <drive letter>: /Delete
OR
(Disconnect all mapped network drives at once)
net use * /Delete
Substitute <drive letter>: in the command above with the actual drive letter (ex: "Z:" ) of the mapped network drive you want to disconnect.
For example:net use Z: /Delete
That's it,
Shawn Brink
Related Tutorials
- Add or Remove Map Network Drive and Disconnect Network Drive from This PC Context Menu in Windows 10
- How to Add or Remove a Network Location for This PC in Windows 10
- Enable or Disable Scan Mapped Network Drives with Microsoft Defender in Windows 10
- How to Mount a Drive to a Folder in Windows 10
- How to Mount Folder as Virtual Drive in Windows 7, Windows 8, and Windows 10
- How to Disable Could not reconnect all network drives notification in Windows 10
- Enable Mapped Drives to be Available in Elevated Command Prompt and PowerShell in Windows