- Home
·
- Miscellaneous
·
- WMI sample showing how to list all shares on the local or remote computer using WMI's Win32_Share o
WMI sample showing how to list all shares on the local or remote computer using WMI's Win32_Share o
WMI sample showing how to list all shares on the local or remote computer using WMI's Win32_Share object.
Rate WMI sample showing how to list all shares on the local or remote computer using WMI's Win32_Share o
(1(1 Vote))
' This function lists all shares on a local or remote computer
' Check out http://www.activxperts.com/activmonitor for more samples and
' components
Option Explicit
Sub ListShares( strComputer )
Dim strObject
Dim colShares
Dim objWMIService, objShare
Set objWMIService = GetObject( "winmgmts://" & strComputer & "/root/cimv2" )
Set colShares = objWMIService.ExecQuery( "Select * from Win32_Share" )
For Each objShare In colShares
Wscript.Echo objShare.Name & " [" & objShare.Path & "]"
Next
End Sub
' Main
Dim strComputer
Do
strComputer = inputbox( "Please enter the name of a computer in your network (or . for local host)", "Input" )
Loop until strComputer <> ""
ListShares( strComputer )
WScript.Echo( vbCrlf & "Ready." & vbCrlf & "Check out http://www.activxperts.com For more samples And components." )
WMI sample showing how to list all shares on the local or remote computer using WMI's Win32_Share o Comments
No comments yet — be the first to post one!
Post a Comment