The net use command is a Command Prompt command used to connect to, remove, and configure connections to shared resources, like mapped drives and network printers.

It’s one of many net commands like net send, net time, net user, net view, etc.

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 in 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 Command Syntax

This command uses the following general syntax:

The availability of certain command switches and other command syntax may differ from operating system to operating system.

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] [/?]

Review how to read command syntax if you’re not sure how to interpret the net use command syntax as it’s shown above or described in the table below.

Net Use Command Examples

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

Save the output of the net use command to a file using a redirection operator. If you’re not familiar with this operation, review how to redirect command output to a file for guidance.

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.

The message “There are no entries in this list.” will show if there aren’t any connections currently set up.

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:.

Get the Latest Tech News Delivered Every Day

  • What Is a Mapped Drive?

  • Copy Command

  • How to Map a Network Drive in Windows 11

  • How to Reset a Windows Vista Password

  • How to Use the Netstat Command

  • Vol Command Examples and Options

  • Net Send Command

  • Net Command

  • How to Map a Network Drive on a Mac

  • How to Redirect Command Output to a File

  • How to Use the Tracert Command in Windows

  • Msg Command (Examples, Switches, and More)

  • How to Use the Netstat Command on Mac

  • How to Use the ‘At’ Command in Windows

  • How to Use the Format Command to Write Zeros to a Hard Drive

  • How to Use the Ping Command in Windows

  • Facebook

  • Twitter

Hit Refresh on Your Tech News

  • About Us

  • Privacy Policy

  • Editorial Guidelines

  • Terms of Use

  • Careers

  • Advertise

  • Contact

  • EU Privacy

  • NEWS

  • HOW TO

  • FEATURES

  • ABOUT US