How to map network drive assigning letter automatically on Windows 11, 10

You can map network drives assigning drive letters automatically to avoid conflicts on Windows 10, and in this guide, you'll learn how to do it.

Assign drive letter to map network drive automatically
Assign drive letter to map network drive automatically

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:

  1. Open Start on Windows 11.

  2. 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.
  3. 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

    et Use map drive with automatic letter

  4. (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. 

About the author

Mauro Huculak is a Windows How-To Expert who started Pureinfotech in 2010 as an independent online publication. He has also been a Windows Central contributor for nearly a decade. Mauro has over 15 years of experience writing comprehensive guides and creating professional videos about Windows and software, including Android and Linux. Before becoming a technology writer, he was an IT administrator for seven years. In total, Mauro has over 21 years of combined experience in technology. Throughout his career, he achieved different professional certifications from Microsoft (MSCA), Cisco (CCNP), VMware (VCP), and CompTIA (A+ and Network+), and he has been recognized as a Microsoft MVP for many years. You can follow him on X (Twitter), YouTube, LinkedIn and About.me. Email him at [email protected].