A Guide to Windows Resource Management

A Guide to Windows Resource Management

Net Use Command Options
OptionExplanation
net useExecute the net use command alone to show detailed information about currently mapped drives and devices.
devicenameUse this option to specify the drive letter or printer port you want to map the network resource to. For a shared folder on the network, specify a drive letter from D: through Z:, and for a shared printer, LPT1: through LPT3:. Use * instead of specifying devicename to automatically assign the next available drive letter, starting with Z: and moving backward, for a mapped drive.
\\computername\sharenameThis specifies the name of the computer, computername, and the shared resource, sharename, like a shared folder or a shared printer connected to computername. If there are spaces anywhere here, be sure to put the entire path, slashes included, in quotes.
volumeUse this option to specify the volume when connecting to a NetWare server. Client Service for NetWare or Gateway Service for Netware must be installed.
passwordThis is the password needed to access the shared resource on computername. You can choose to enter the password during the execution of the net use command by typing * instead of the actual password.
/userUse this net command option to specify a username to connect to the resource with. If you don’t use /user, net use will attempt to connect to the network share or printer with your current username.
domainnameSpecify a different domain than the one you’re on, assuming you’re on one, with this option. Skip domainname if you’re not on a domain or you want net use to use the one you’re already on.
usernameUse this option with /user to specify the username to use to connect to the shared resource.
dotteddomainnameThis option specifies the fully qualified domain name where username exists.
/homeThis net use command option maps the current user’s home directory to either the devicename drive letter or the next available drive letter with *.
/persistent:{yes | no}Use this option to control the persistence of connections created with the net use command. Choose yes to automatically restore created connections at the next login or choose no to limit the life of this connection to this session. You can shorten this switch to /p if you like.
/smartcardThis switch tells the net use command to use the credentials present on the available smart card.
/savecredThis option stores the password and user information for use next time you connect in this session or in all future sessions when used with /persistent:yes.
/deleteThis net use command is used to cancel a network connection. Use /delete with devicename to remove a specified connection or with * to remove all mapped drives and devices. This option can be shortened to /d.
/helpUse this option, or the shortened /h, to display detailed help information for the net use command. Using this switch is the same as using the net help command with net use: net help use.
/?The standard help switch also works with the net use command but only displays the command syntax, not any detailed information about the command’s options.

Net Use Command Examples

Following are a few different ways you might use this command:

Temporary Mapped Drive

 net use * "\\server\my media" /persistent:no

In this example, we used the net use command to connect to the my media shared folder on a computer named server. The my media folder will be mapped to the highest available drive letter [*], which in our example happens to be y:, but we don’t want to continue mapping this drive every time we log onto the computer [/persistent:no].

Permanent Mapped Drive

 net use e: \\usrsvr002\smithmark Ue345Ii /user:pdc01\msmith2 /savecred /p:yes

The above is a slightly more complicated example that you might see in a business setting.

In this net use example, we want to map our e: drive to the smithmark shared folder on usrsvr002. We want to connect as another user account we have [/user] by the name of msmith2 that’s stored on the pdc01 domain with a password of Ue345Ii. We don’t want to map this drive manually every time we start the computer [/p:yes], nor do we want to enter the username and password each time [/savecred].

List All Shared Resources

 net use

In this simple example of the net use command, we get a list of all the shared resources currently in use under the user account that’s currently logged in. In our example, the result in Command Prompt shows “Z: \\server\shared folder\” since z: is the drive letter that’s connecting to shared folder on server.

If there are no current connections set up, the message “There are no entries in this list.” will appear.

Unmap a Drive

 net use p: /delete

An appropriate final example of net use is the removal [/delete] of a currently mapped drive, in this case, p:.

Net Use Command Availability

This command is available from within the Command Prompt in Windows 11, Windows 10, Windows 8, Windows 7, Windows Vista, and Windows XP, and in older versions of Windows and Windows Server operating systems.

Recovery Console, the offline repair utility in Windows XP, also includes the net use command, but it’s not possible to use it within the tool.

Net use is one of many net commands like net send, net time, net user, net view, etc.

Leave a Comment

Your email address will not be published. Required fields are marked *