'==========================================================================
'
'
' NAME: <listName_Path_Max_Shares.vbs>
'
' AUTHOR: Ed Wilson , MS
' DATE  : 5/7/2006
'ver. 1.1 made only couple changes to structure
' COMMENT: <uses Win32_share object
' uses select name to return name, path and AllowMax properties
' 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"
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 vbNewLine
Next