List Windows Shares from the cmd line?

mobot
mobot used Ask the Experts™
on
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
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
JohnBusiness Consultant (Owner)
Most Valuable Expert 2012
Expert of the Year 2018

Commented:
Try NET USE (no parameters). That gives me what I need.
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.
Most Valuable Expert 2018
Distinguished Expert 2018
Commented:
net.exe share

Open in new window

or
wmic.exe path win32_share get Caption,Name,Path

Open in new window

or remote:
wmic.exe /node:<ServerName> path win32_share get Caption,Name,Path

Open in new window

Introduction to R

R is considered the predominant language for data scientist and statisticians. Learn how to use R for your own data science projects.

Raheman M. AbdulSenior Infrastructure Support Analyst & Systems Developer

Commented:
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

NVITEnd-user support

Commented:
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
Mike TLeading Engineer

Commented:
Hi,

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 :).

Mike

Author

Commented:
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

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial