Hello,
You can use the following command format:
net use [drive letter:] [\server\share] [password /user:username] [/persistent:yes|no]
For example, if you want to map the shared resource public
on the remote computer server1
to the local Z drive, and want this mapping to persist across reboots while using the credentials of the default login user, you can this way:
net use Z: \server1\public /persistent:yes
If you need to provide a specific username and password for authentication, you can do this: net use Z: \server1\public password /user:domain\username /persistent:yes
Please note that in the above command, replace Z:
with the desired local drive letter, \\server1\public
with the actual share path, password
with the password of the corresponding user, and domain\username
with the included domain name (if any) and username. After executing the above command, the successfully mapped network drive will be displayed as a new drive icon in the file explorer. Users can directly click on the drive to browse and operate the files and directories in it.
I hope this helps!
Best regards
Zunhui