Drive 对象

提供对特定磁盘驱动器或网络共享属性的访问。

说明

下面的代码演示了如何用 Drive 对象访问驱动器属性:

function ShowFreeSpace(drvPath)
{
   var fso, d, s;
   fso = new ActiveXObject("Scripting.FileSystemObject");
   d = fso.GetDrive(fso.GetDriveName(drvPath));
   s = "Drive " + drvPath + " - " ;
   s += d.VolumeName + "<br>";
   s += "Free Space: " + d.FreeSpace/1024 + " Kbytes";
   return(s);
}

方法

Drive 对象没有方法。

属性

VolumeName 属性

请参阅

GetDrive 方法