'==========================================================================
'
'
' NAME: <listSpecificWhereVariableShares.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
Dim vWhere

strComputer = "."
wmiNS = "\root\cimv2"
vWhere = " name = 'c$'"
wmiQuery = "Select Name, path, allowMaximum from win32_Share where " & vWhere
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
    WScript.Echo
    
Next