What Is Net Use Command and How to Map a Network Drive with It

Aaron Paul updated on Sep 22, 2022 to Knowledge Center

What Is Net Use Command?

Net Use Command is a command-line tool that was introduced in Windows 2000. Now, it is available in all subsequent versions of the Windows operating system. Net Use Command is used to manage network connections. The command can be used to map a network drive, connect to a shared folder, disconnect from a share, and more.

It is quite helpful, as it can be used to automate various tasks related to network management. For instance, you can use Net Use Command to connect or disconnect a shared resource, display information, and set user-specific settings.

Here we will take a closer look to reflect on Net Use Command and learn how to map a network drive.

net use command map a drive

 Net Use Command Syntax and Options

The syntax of the Net Use Command refers to the order of the parameters you need to type to execute a specific task. The options, on the other hand, are used to modify the behaviour of the command.

Net Use Command Syntax:

Here is the syntax of the Net Use Command:

net use [{devicename | *}] [\\computername\sharename[\volume] [{password | *}]] [/user:[domainname\]username] [/user:[dotteddomainname\]username] [/user:[username@dotteddomainname] [/home {devicename | *} [{password | *}]] [/persistent:{yes | no}] [/smartcard] [/savecred] [/delete] [/help] [/?]

Net Use Command Options:

The options that you can use with the Net Use Command are as follows:

  • devicename: Specifies the name of a device to assign to a local resource, such as * for all devices.
  • \\computername\sharename: This is the network path to the shared resource.
  • volume: This is an optional parameter that specifies the storage volume label of the shared resource.
  • password: Highlight the password to use when connecting to a shared resource.
  • /user: Specifies the user name with which to log on. If omitted, the currently logged-on user is assumed.
  • domainname: This is the user account's domain with which to log on.
  • username: This is the user name with which to log on.
  • /home: Uses the user's home directory specified by UserName or the currently logged-on user.
  • /persistent:{yes | no}: Highlights whether the redirection is persistent.
  • /smartcard: Uses a Smart Card for authentication.
  • /savecred: State that the credentials used for this connection should be saved by Winlogon and reused when this resource is accessed.
  • /delete: Defines whether the entries for this connection in the Local Security Authority (LSA), such as passwords and user names, should be deleted when this connection is removed.
  • /help: Specifies whether you want to display Help information for this command.
  • /?: Same as /help.

 How to Use Net Use Command in Windows?

Below are the steps that you need to follow to use the Net Use Command in Windows:

Step 1: Go to Command Prompt and type net use.

Use net use command in windows

Step 2: Net Use Command will display the current connections if no parameters are specified.

Net use command line

Step 3: If you want to see the options available with the Net Use Command, you need to type net use /? or net use /help and press Enter. If you want to know more about a specific connection, you can also use the /? Option. For instance, for the 'Persistent' option, you need to type net use /? Persistent and press Enter.

How Do I Map a Network Drive Using Net Use?

Mapping a network drive is a process of connecting to a shared network folder, so you can get into this like a local drive with the help of Microsoft Windows. You will learn here how to map a network drive using Net Use Command.

Before starting, you need to know the following things:

  • Computer name that you want to connect to
  • The name of the shared folder on that computer
  • If the shared folder requires a different set of permissions or credentials than your normal logon provides

Steps to map a network drive

Step 1: Search Command Prompt and select Command Prompt (Admin).

Step 2: Type the mentioned command in the Command Prompt window and press Enter net use [Drive:] \\[ComputerName\ShareName]. For example, to map the root of the shared folder named Share on ComputerName to the Z: drive, type the following command and press Enter: net use z: \\computername\share

map a network drive using net use

Step 3: You will be prompted to enter the credentials. After typing, the credentials, click Enter.

Note: If you want to use different credentials than your current logon provides, then you need to type the following command: net use [Drive:] \\[ComputerName\ShareName] /user:[DomainName\Username] [Password]

For example, to map the root of the shared folder named Share on ComputerName to the Z: drive by using the User1 account in the Contoso domain, type the following command:  net use z: \\computername\share /user:contoso\user1 password

Step 4: To verify that the shared folder is mapped to the drive, type the mentioned command in Command Prompt and tap Enter: "net use" you will see the list of all mapped drives.

Step 5: To disconnect the mapped network drive, type the following command in Command Prompt and press Enter:  net use [drive:] /delete

For example, to disconnect the Z: drive, type the following command and press Enter: net use z: /delete

Note: You can also use * as a wildcard character for the Drive to delete all mapped network drives.

After reading this, we hope you can map a network drive using Net Use Command. If you have any suggestions or thoughts, feel free to leave them in the comments below.

Was This Page Helpful?