The "Net Use" command is a command-line utility introduced in Windows 2000 and is available in all subsequent versions of the Windows operating system. It is used for managing network connections. This command can be employed to map network drives, connect to shared folders, disconnect from shared resources, and more.
It is very helpful for automating various network-related tasks, such as connecting or disconnecting from shared resources, displaying information, and setting options for a specific user.
In this article, we will take a closer look at the Net Use command and how to map a network drive.
The syntax of the "Net Use" command refers to the order of parameters required when executing a specific task. On the other hand, options are used to modify the behavior of the command.
Here's the syntax for the Net Use command:
NET USE {device name | *} [\computer name\share name[\volume] [{password | * }] ] [/USER:[domain\]user name] [/USER:[dot-separated domain\]user name] [/USER:[user name@dot-separated domain] ] [/HOME {device name | *} [{password | * }] ] [/PERSISTENT:{YES | NO} ] [/SMARTCARD] [/SAVECRED] [/DELETE] [/HELP] [/?]
The options you can use with the Net Use command are:
UserName
, or the home directory of the current logged-in user./persistent:{yes|no}: Specifies whether the redirect is persistent.
/help
.Here are the steps to follow when using the Net Use command in Windows:
Step 1: Open the Command Prompt and type net use.
If Net Use is issued with no parameters, it displays the current connections.
Step 3: To view the available options for the "Net Use" command, type in net use /? or net use /help, then press Enter. You can also use the /? option to learn more about a specific connection. For example, to learn about the "Persistent" option, type in net use /? Persistent, then hit Enter.
Mapping a network drive is the process of connecting to a shared network folder through Microsoft Windows so that you can access it like a local drive. Here, you'll learn how to use the Net Use command to map a network drive.
Before you begin, there are a few things you should know:
Step 1: Search for “Command Prompt,” and then select “Run Command Prompt as administrator.”
Step 2: Type the following command at the command prompt, and then press Enter: net use [Drive:] \\[ComputerName]\[ShareName]. For example, to map the root of the Share shared folder on a computer named ComputerName to drive Z:, type the following command, and then press Enter: net use z: \\computername\share
Step 3: The system will prompt you to enter the credentials. Type them in and press Enter.
Note: If you want to use credentials different from the ones you're currently logged on with, type the following command: net use [drive:] \\[computer name]\sharename /user:[domain\username] [password]
For example, to map the root of a shared folder named Share to drive Z: 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 a drive, type the command above in Command Prompt and press Enter: “net use” will display a list of all mapped drives.
Step 5: To disconnect a mapped network drive, type the following command at the Command Prompt, and then press Enter: net use [drive:] /delete
For example, to disconnect the Z: drive, type the following command, and then press ENTER: net use z: /delete
Note: You can also use an asterisk (*) as a wildcard to remove all mapped network drives.
After going through this tutorial, you should be able to use the Net Use command to map a network drive. If you have any suggestions or ideas, feel free to leave a comment below.