VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



WMI sample showing how to list all shares on the local computer using WMI's Win32_Share object.

by ActivXperts Software (1 Submission)
Category: Miscellaneous
Compatability: Visual Basic 5.0
Difficulty: Unknown Difficulty
Originally Published: Wed 19th February 2003
Date Added: Mon 8th February 2021
Rating: (1 Votes)

WMI sample showing how to list all shares on the local computer using WMI's Win32_Share object.

Rate WMI sample showing how to list all shares on the local computer using WMI's Win32_Share object.



' This function lists all shares on the local computer

' Check out http://www.activxperts.com for more samples and components


Option Explicit

Sub ListShares()
Dim strObject
Dim colShares
Dim objWMIService, objShare

Set objWMIService = GetObject( "winmgmts:" )
Set colShares = objWMIService.ExecQuery( "Select * from Win32_Share" )
For Each objShare In colShares
Wscript.Echo objShare.Name & " [" & objShare.Path & "]"
Next

End Sub



' Main


ListShares()

WScript.Echo( vbCrlf & "Ready." & vbCrlf & "Check out http://www.activxperts.com For more samples And components." )

Download this snippet    Add to My Saved Code

WMI sample showing how to list all shares on the local computer using WMI's Win32_Share object. Comments

No comments have been posted about WMI sample showing how to list all shares on the local computer using WMI's Win32_Share object.. Why not be the first to post a comment about WMI sample showing how to list all shares on the local computer using WMI's Win32_Share object..

Post your comment

Subject:
Message:
0/1000 characters