- Home
·
- Internet/HTML
·
- WMI sample: list shares on a local computer. Written in VBScript
WMI sample: list shares on a local computer. Written in VBScript
WMI sample: list shares on a local computer. Written in VBScript
Rate WMI sample: list shares on a local computer. Written in VBScript
(2(2 Vote))
' This function lists all shares on the local computer
' Check out http://www.activexperts.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.activexperts.com For more samples And components." )
WMI sample: list shares on a local computer. Written in VBScript Comments
No comments yet — be the first to post one!
Post a Comment