On Windows 11 (or Windows 10), you can use the “net use” command to quickly map a network drive to access files on a shared folder located on a server or another computer in the network. The only caveat is that you usually have to specify a driver letter to make the drive available in File Explorer. However, if the letter is already in use, the drive will not connect.
If you want to avoid mapping problems, you can use a specific command option that will automatically assign a drive letter.
This guide will teach you the steps to use Command Prompt to map a network drive without specifying a drive letter.
Map network drive assigning letter automatically on Windows 11, 10
To map a network drive on Windows 11 or 10 by assigning a drive letter automatically, use these steps:
-
Open Start on Windows 11.
-
Search for Command Prompt and click the top result to open the app.
Quick note: If you run the command as an administrator, the drive may not mount correctly, and it won’t appear in File Explorer. As a result, run the command as a standard user. -
Type the following command to map the network drive using the next available drive letter and press Enter:
net use * \\DEVICE-NAME-OR-IP\SHARED-FOLDER
In the command, the (*) is the option that allows the system to assign any drive letter that is not already in use. Remember to replace DEVICE-NAME-OR-IP and SHARED-FOLDER for the name of 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:
net use * \\vm-beta\ShareOne
-
(Optional) Type the following command to map the network drive using the next available drive letter providing sign-in credentials and press Enter:
net use * \\DEVICE-NAME-OR-IP\SHARED-FOLDER PASSWORD /user:USERNAME /persistent:yes
In the command, the (*) is the option that allows the system to assign any drive letter that is not already in use. Remember to replace DEVICE-NAME-OR-IP and SHARED-FOLDER for the name of 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 device. 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:
net use * \\vm-beta\ShareOne password /user:admin /persistent:yes
Once you complete the steps, the network drive will automatically map with the next available drive letter, and the command will let you know the letter the new map is using.
Using the net use
command, you can disconnect, make mapped network drives persistent, connect using different credentials, and more. Here you can learn more about how to use the map command on Windows 10.
This guide focuses on Windows 10 and 11, but you can use the same command on Windows 8.1, Windows 7, and previous versions.