Error DataBase-One Place all Solutions Forums Blog Glossary    Contact Us
Search  
   
Browse by Category
Error DataBase-One Place all Solutions .: Operating Systems .: Windows Operating Systems .: Windows Scripts and Batch Files .: VBScript to List Network Shares with InputBox

VBScript to List Network Shares with InputBox

Instructions for displaying a list of a Computers shared drives

  1. Copy and paste the script below into notepad.
  2. Save the file with a .vbs extension e.g. ListShare2.vbs.
  3. Double click, enter the name of the server in the dialog box, then read the names of the shares in the message box.

 

' ListShare2.vbs Windows Logon Script
' VBScript List Shares on a Server
' Author Guy Thomas http://computerperformance.co.uk/
' Version 2.7 - May 2005
' ----------------------------------------------------'
Option Explicit

Dim objFs, objShare
Dim strServer, strList

' The section sets the variables
strList = " --------------------------- "
strServer = "GuyServer"

' Creates the Input Message Box
strServer = InputBox("Server to list shares: "_
," Share List", strServer)

' Connects to the operating system's file system
set objFs = GetObject("WinNT://" _
& strServer & "/LanmanServer,FileService")

' Loops through each share
For Each objShare In objFs
strList = strList & vbCr & LCase(objShare.name) _
& " " & vbTab & UCase(objShare.Description)
Next

WScript.Echo strList


How helpful was this article to you?

Related Articles

article VBScript to List Network Shares
This script will interrogate the operating...

(No rating)  5-1-2008    Views: 137   
article VBScript to find uptime for the list of server
On Error Resume NextConst...

(No rating)  5-5-2008    Views: 175   
article VBScript to Change Admin Password on a list of Computers
Create a text file listing one computer...

(No rating)  5-2-2008    Views: 141   

User Comments

Add Comment
No comments have been posted.