Net Use Command: Complete Guide
The net use command in Windows system is a command used for managing shared resources, allowing users to connect, disconnect, map, and list network shared resources.
The syntax of the net use command is as follows:
net use [device name] [shared path] [/PERSISTENT:{YES | NO}] [/USER:[domain] username [password]] [/SAVECRED] [/DELETE] [/SMARTCARD]
Each parameter has the following meanings:
- Device Name: Specify the name of the device to map or disconnect.
- Shared path: specifies the network share path to connect or disconnect from.
- /PERSISTENT:{YES | NO}: Specifies whether to keep the connection after a system reboot. YES indicates it will be kept, NO indicates it will not be kept, and the default is NO.
- User: Specified username and password to use when connecting to shared resources.
- /SAVECRED: Specifies whether to save user credentials for use in future sessions. If this option is specified, users will need to enter their username and password when connecting to shared resources for the first time, and the saved credentials will be automatically used for subsequent connections.
- /REMOVE: Disconnect the specified device mapping.
- SMARTCARD: Specifies the use of a smart card for identity verification.
By using the net use command, you can achieve the following functions:
- Connect to network shared resources: By specifying the device name and shared path, you can connect network shared resources to your local computer, enabling access to them on your local computer.
- Disconnect network shared resources: disconnect already connected network shared resources by specifying the device name.
- Map network shared resources: By specifying the device name and shared path, network shared resources can be mapped to a drive on the local computer, allowing them to be used on the local computer just like a local disk.
- List connected network shared resources: display the current list of connected network shared resources.
By using the “net use” command, users can easily manage and access network shared resources, thus improving work efficiency.