function getVolumeName(drivePath) { //Create a file system object var fileSysObj = new ActiveXObject("Scripting.FileSystemObject"); //Create a Drive object for the drivePath var drive = fileSysObj.GetDrive(fileSysObj.GetDriveName(drivePath)); //Return volume name of the drive return(drive.VolumeName); }