Drive.Path

JScript3.0+Syntax

							driveobject.Path

Description

The Path property of the Drive object contains the path of the specified file, folder, or drive.

Example

Listing 9.32 displays drive C's path.

Listing 9.32 Display the Path of Drive C
<script language="JScript">
<!-- Hide

//Create a string to hold the drive path
var drivePath = "C:";

//Create a file system objectvar fileSysObj = new
ActiveXObject("Scripting.FileSystemObject");

//Create a Drive object for drive C
var drive = fileSysObj.GetDrive(fileSysObj.GetDriveName(drivePath));

//Display the path of drive C
document.write("The path of drive C is ",drive.Path);

//Hide End -->
</script>
						

Get Pure JavaScript 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.