Quick References
      ADO
      ASP
      CSS2
      HTML
      JavaScript
      Jet SQL
      VBScript
      WML
      WMLScript
      WSH
      XHTML
      XML DOM
      XSLT

Features
      Knowledge Base
      Tutorials

Partners
     ZVON.ORG
     XML
     Planet Source Code
     VisualBuilder
     Web Design
     Your HTML Source
     XML/XSLT Forums
     ASPAlliance
     Scripts
     
     Programmers Heaven
     Tek-Tips Forums
     Developer Fusion
     Code Project











Method:  WshNetwork.EnumNetworkDrives

WshNetwork.EnumNetworkDrives()

The EnumNetworkDrives method returns a WshCollection object that is a collection of the local and remote names of all the mapped network drives. All the even-indexed elements in the collection are local names, while all the odd-indexed elements in the collection are remote names. Further, the elements are paired (0 and 1 are the first drive, 2 and 3 are the second drive, etc.)

The following VBScript code lists all the mapped network drives on a machine.

Code:
Set WshNetwork = WScript.CreateObject("WScript.Network")
Set clDrives = WshNetwork.EnumNetworkDrives
For i = 0 to clDrives.Count -1
    WScript.Echo clDrives.Item(i)
Next


Output:
P:
\\FileServer\public
Q:
\\FileServer\upload

 


Copyright 1999-2005 by Infinite Software Solutions, Inc. All rights reserved.
Trademark Information