what is proper command line to issue to display shared drive in File Explorer when mapped by Net Use?

Anonymous
2024-03-27T16:57:19+00:00

if i map a share for my users manually, the share is displayed as expected in File Explorer for them.

     NewShare (\\*servername*) (K:)

if i write a script containing net use with all the parameters testing correctly, the share exists but it does not display for them in File Explorer. i have more than several users so it would be beneficial to be able to have them run a .bat file or PowerShell script to generate the share and have the new share show up in File Explorer for them. i'm sure i'm just missing a parameter in net use to ensure the share is displayed as expected. all user computers run Win11 Pro. all suggestions are appreciated.

***moved from Windows / Windows 11 / Files, folders, and storage***

Windows Windows Client for IT Pros Networking Network connectivity and file sharing

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question. To protect privacy, user profiles for migrated questions are anonymized.

0 comments No comments
{count} vote
Accepted answer
  1. Anonymous
    2024-03-29T10:18:38+00:00

    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.

    Net use | Microsoft Learn

    I hope this helps!

    Best regards

    Zunhui

    0 comments No comments

0 additional answers

Sort by: Most helpful