Link to home
Start Free TrialLog in
Avatar of mobot
mobotFlag for United States of America

asked on

List Windows Shares from the cmd line?

I'm asking for the cmd that will list the share name and the folder path and the description?

I've used 'net view \\servername' and it kicks out the Share name and Type.  I need the folder path and the description too.

Windows Server 2003 SP2
Avatar of John
Flag of Canada image

Try NET USE (no parameters). That gives me what I need.
Avatar of Bryant Schaper
Invoke-Command -ComputerName xxxxx -ScriptBlock { gwmi -q "SELECT * FROM Win32_Share WHERE
 Name != 'ADMIN$' AND Name != 'IPC$'" }"

sub computername at xxxx

But I used powershell, not sure if it will work for you.
Avatar of oBdA

Link to home
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
You can get from powershell:
Open Powershell cmd by  Start -> Run -> Powershell
Then in powershell window type:
 Get-WmiObject -Class win32_share

Open in new window

You can either
... at the server: net share which shows the shares for that server

... at the client: rmtshare \\servername
Here's one link you can get rmtshare at: Windows 2000 Resource Kit

There are many ways to do this. I like the GUI method: type fsmgmt.msc from run or command shell.
All other methods have already been mentioned above :).

Avatar of mobot


This is what worked for me.  Sorry for the delay in getting back to everyone.  And thanks to all for your suggestions.

wmic.exe path win32_share get Caption,Name,Path