Features
Ask DevGuru
ASP Resources
Find the Bug
Knowledge Base
Links
Tips of the Week
Tutorials
Products
dgCalendar
dgCharge New!
dgChart New!
dgFileUpload
dgReport New!
dgSort
dgTree
Site
Authoring
Coming Soon
DevGuru Resume
Link to Us
Merchandise
Sponsorships
Testimonials
What's New
Technologies
ADO 2.6
ASP
CSS2
HTML
JavaScript
Jet SQL
Transact-SQL Syntax
VBScript
WML
WMLScript
WSH
XML DOM
All Objects
Drives Object
Drives Property
File Object
Files Collection
Folder Object
Folders Collection
OBJECT: Drives Collection
Implemented in version 3.0
The
Drives
collection is the collection of all the disk drives available on the system. This collection is obtained through the
Drives
property of the
FileSystemObject
object.
The following code gets the
Drives
collection, creates a list of available drives and displays the results in the browser.
Code:
<%
Dim filesys, drv, drvcoll, drvlist, vol
Set filesys = CreateObject("Scripting.FileSystemObject")
Set drvcoll = filesys.Drives
For Each drv in drvcoll
drvlist = drvlist & drv.DriveLetter
If drv.IsReady Then
vol = drv.VolumeName
End If
drvlist = drvlist & vol & ", "
Next
Response.Write "Drives available on this system are " & drvlist
%>
Output:
"Drives available on this system are A, C, D, E, "
PROPERTIES
Count Property
Returns an integer that tells us how many
Drive
objects there are in the collection (the number of local and remote drives available).
Syntax:
object.
Count
Item
Property
The
Item
property allows us to retreive the value of an item in the collection designated by the specified
key
argument and also to set that value by using
itemvalue
.
Syntax:
object.
Item
(key)
[ = itemvalue]
Copyright 1999-2001 by Infinite Software Solutions, Inc. All rights reserved.
Trademark Information