FileSystemObject.GetDriveName Method (VB6)

Named Arguments

Yes

Syntax

oFileSysObj.GetDriveName (Path)

oFileSysObj

Use: Required

Data Type: FileSystemObject object

Any object variable returning a FileSystemObject object.

Path

Use: Required

Data Type: String

A path specifier.

Return Value

A String.

Description

Returns the drive name of a given path.

Rules at a Glance

If the drive name can't be determined from the given path, a zero-length string ("") is returned.

Programming Tips and Gotchas

  • GetDriveName doesn't verify that a given drive exists in Path.

  • Path can be a network drive or share.

Get VB & VBA in a Nutshell: The Language now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.