by Anonymous (267 Submissions)
Category: Internet/HTML
Compatability: Visual Basic 5.0
Difficulty: Unknown Difficulty
Originally Published: Sun 4th May 2003
Date Added: Mon 8th February 2021
Rating: (1 Votes)
WMI sample: list shares on a local or a remote computer. Written in VBScript
' This function lists all shares on a local or remote computer
' Check out http://www.activexperts.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.activexperts.com For more samples And components." )
No comments have been posted about WMI sample: list shares on a local or a remote computer. Written in VBScript. Why not be the first to post a comment about WMI sample: list shares on a local or a remote computer. Written in VBScript.