'==========================================================================
'
'
' NAME: <listSpecificShares.vbs>
'
' AUTHOR: Ed Wilson , MS
' DATE  : 10/28/2003
'
' COMMENT: <uses Win32_share object
' uses select name to return name, path and AllowMax properties
' uses where clause to limit return
' uses for next to iterate through the collection>
'
'==========================================================================

Option Explicit 
'On Error Resume Next
dim strComputer
dim wmiNS
dim wmiQuery
Dim objWMIService
dim colItems
dim objItem

strComputer = "."
wmiNS = "\root\cimv2"
wmiQuery = "Select path, allowMaximum from win32_Share" &_
	" where name = 'C$'"
Set objWMIService = GetObject("winmgmts:\\" & strComputer & wmiNS)
Set colItems = objWMIService.ExecQuery(wmiQuery)

For Each objItem in colItems
    WScript.Echo "Name: " & objItem.Name
    WScript.Echo "Path: " & objItem.path
    WScript.Echo "AllowMaximum: " & objItem.AllowMaximum  
Next