When connecting to a network drive, Windows 10 essentially creates a “shortcut” that points to the shared folder with a drive letter and the username and password to access its content. Once a drive is mapped, it will appear on “This PC” under “Network locations” to quickly access files stored on another computer from File Explorer. This guide will teach you the steps to use Command Prompt to map a network drive on Windows 10 and how to disconnect when you no longer need access to the shared folder.

Map network drive on Windows 10 with Command Prompt Disconnect mapped network drive on Windows 10 with Command Prompt

Map network drive on Windows 10 from Command Prompt

To use the net command to map a shared folder as a drive, use these steps: Once you complete the steps, the network folder will map on the device and appear in File Explorer. In the command, replace “Z” with the drive letter not already in use you want to use. Then replace DEVICE-NAME-OR-IP and SHARED-FOLDER for the computer name or IP address of the device hosting the shared folder and the name of the shared. For example, this command maps the ShareOne folder to the computer with the “Z” drive letter:

In the command, the (*) is the option that allows the system to assign any drive letter that is not already in use. Then replace DEVICE-NAME-OR-IP and SHARED-FOLDER for the computer name or IP address of the device hosting the shared folder and the name of the shared. For example, this command maps the ShareOne folder to the computer:

In the command, replace “Z” with the drive letter not already in use you want to use. Then change DEVICE-NAME-OR-IP and SHARED-FOLDER for the computer name or IP address of the device hosting the shared folder and the name of the shared. The PASSWORD and USERNAME have to be replaced with the credentials to authenticate with the remote machine. The “persistent” option allows the folder to stay mapped after reboot. For example, this command maps the ShareOne folder providing the user credentials and making the mapping persistent:

Disconnect mapped network drive on Windows 10 from Command Prompt

To disconnect a network drive on Windows 10, use these steps: After you complete the steps, the mapped drives will be disconnected and no longer accessible from File Explorer.

In the command, replace “Z” with the drive letter of the map you want to remove. While we focus this guide on Windows 10, you can use these steps on Windows 8.1, 7, and earlier versions. Use these instructions if you want to use File Explorer to complete this task. All content on this site is provided with no warranties, express or implied. Use any information at your own risk. Always backup of your device and files before making any changes. Privacy policy info.