Categories: Remote access

List mapped drives from command line

We can use the command below to see the list of shares mapped as network drives.

c:> net use




See also:
Delete mapped drives command line
Map drive to network share from command line



Srini

View Comments

    • This will list all mapped drives for the user running the PowerShell console.

      Get-WmiObject Win32_NetworkConnection | Select-Object RemoteName, LocalName | Sort-Object LocalName | Format-Table -AutoSize

    • For powershell I highly recommend this command to show mapped drives:
      Get-SMBMapping

      And here are 2 other commands you can use for similar effect.
      Get-PSDrive -PSProvider FileSystem | Select-Object name, @{n="Root"; e={if ($_.DisplayRoot -eq $null) {$_.Root} else {$_.DisplayRoot}}}

      Get-WmiObject -Class Win32_MappedLogicalDisk | select Name, ProviderName

  • In powershell,
    Get-WmiObject Win32_NetworkConnection | ft "LocalName","RemoteName" -A
    does not show that error
    Regards

Share
Published by
Srini

Recent Posts

Add new user account from command line (CMD)

Adding users from command line is much easier than going through the UI. It saves…

4 years ago

Delete directory from command line [Rmdir]

Do you want to delete a directory from Windows command prompt(CMD)? This post explains how…

4 years ago

TaskKill: Kill process from command line (CMD)

We can kill a process from GUI using Task manager. If you want to do…

4 years ago

Kill Chrome from command line

Chrome is definitely the stable browser compared to other ones and it has been my…

4 years ago

Find windows OS version from command line

Windows has multiple command line utilities that can help find the version of the Windows…

4 years ago

How to check if Windows 32 or 64 bit?

There are multiple ways to check whether a Windows computer is running 32-bit OS or…

7 years ago