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
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-2005 by Infinite Software Solutions, Inc. All rights reserved.
Trademark Information