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 Methods
FileSystemObject Object
GetDriveName Method
METHOD: FileSystemObject.GetDrive
Implemented in version 2.0
object.
GetDrive
(drivename)
This method returns the drive object that is specified by the
drivename
argument.
The
drivename
argument must be in an accepted format:
A drive letter such as, c
A drive letter with a colon such as, c:
A drive letter with a colon and a path such as, c:\hisfolder\herfile
You also may use the
GetDriveName
method to obtain the
drivename
argument.
If the drive does not exist or the format is not correct, the
GetDrive
method will return an error.
Code:
<%
dim filesys, name, DriveObject
Set filesys = CreateObject("Scripting.FileSystemObject")
name = filesys.GetDriveName("c:\DevGuru\website\VBScript.txt")
Set DriveObject = filesys.GetDrive("c:\DevGuru\website\VBScript.txt")
Response.Write(name)
%>
Output:
"c:"
Copyright 1999-2001 by Infinite Software Solutions, Inc. All rights reserved.
Trademark Information