' +----------------------------------------------------------------------------+ ' | Jeffrey M. Hunter | ' | jhunter@idevelopment.info | ' | www.idevelopment.info | ' |----------------------------------------------------------------------------| ' | Copyright (c) 1998-2009 Jeffrey M. Hunter. All rights reserved. | ' |----------------------------------------------------------------------------| ' | FILE : ListShares.vbs | ' | CLASS : Networking | ' | PURPOSE : Enumerate through all connected (network shared) drives. | ' | PARAMETERS : None | ' | USAGE : cscript ListShares.vbs //NoLogo | ' | NOTE : As with any code, ensure to test this script in a development | ' | environment before attempting to run it in production. | ' +----------------------------------------------------------------------------+ Option Explicit Function Main Dim objNetwork Dim objMappedDrives, i Set objNetwork = WScript.CreateObject("WScript.Network") Set objMappedDrives = objNetwork.EnumNetworkDrives For i = 0 To objMappedDrives.Count - 1 Step 2 WScript.Echo(objMappedDrives(i) + " is connected to " + objMappedDrives(i+1)) Next Set objNetwork = Nothing End Function Main WScript.Quit(0)