Scripting Runtime Library(FileSystemObject)

µå¶óÀ̺곪 ³×Æ®¿öÅ© °øÀ¯ ¿µ¿ªÀÇ Àüü °ø°£À» ¹ÙÀÌÆ® ´ÜÀ§·Î ¹ÝȯÇÑ´Ù.

Àμö
object : (°³Ã¼)

objectName´Â Ç×»ó Drive °³Ã¼ÀÌ´Ù.

: (¼Ó¼º Á¤¼ö°ª)
¼Ó¼º°ªÀº ¹®¼­ º»Ã¼ÀÇ ¸ÇÀ§ ¸¶ÁøÀ» Çȼ¿´ÜÀ§ Á¤¼ö·Î ³ªÅ¸³»´Â Á¤¼ö°ªÀÌ´Ù.

ÀÌ ¼Ó¼ºÀº ÀбâÀü¿ëÀÌ¸ç µðÆúÆ®°ªÀº ¾ø´Ù.

¼³¸í

ÁöÁ¤ÇÑ µå¶óÀ̺곪 ³×Æ®¿öÅ© °øÀ¯ ¿µ¿ªÀÇ Àüü °ø°£ÀÇ Å©±â¸¦ byte ¼ö·Î ¹ÝȯÇÑ´Ù.


TotalSize ¼Ó¼º ¿¹Á¦

°á°ú Ç¥½Ãâ
JScript TotalSize ¼Ó¼º ¿¹Á¦
<SCRIPT language=JScript>
function TotalSizeTest(){
  var fso,driveObj,str='';
  fso=new ActiveXObject('Scripting.FileSystemObject');
  enumObj=new Enumerator(fso.Drives);
  for (; !enumObj.atEnd(); enumObj.moveNext()){
    driveObj=enumObj.item();
    str+='µå¶óÀ̺ê '+driveObj.DriveLetter+': - ';
    if (driveObj.IsReady) str+=driveObj.TotalSize+' byte<BR>';
    else str+='Áغñ ¾ÈµÊ<BR>';
  }
  return(str);
}
</SCRIPT>

<DIV id=showjs class=show alt="°á°ú">°á°ú Ç¥½Ãâ</DIV>
<DIV class=show onClick="showjs.innerHTML=TotalSizeTest()">
  <SPAN class=ie>JScript</SPAN> <SPAN class=property>TotalSize</SPAN> ¼Ó¼º ¿¹Á¦</DIV>

VBScript·Î ¹Ýº¹

°á°ú Ç¥½Ãâ
VBScript TotalSize ¼Ó¼º ¿¹Á¦
<SCRIPT language=VBScript>
Function TotalSizeTestvb()
  Dim fso,driveObj
  str=""
  Set fso=CreateObject("Scripting.FileSystemObject")
  Set drivesCol=fso.Drives
  For Each driveObj in drivesCol
    str=str&"µå¶óÀ̺ê "&driveObj.DriveLetter&": - "
    If driveObj.IsReady Then
      str=str&driveObj.TotalSize&" byte<BR>"
    Else str=str&"Áغñ ¾ÈµÊ<BR>"
    End If
  Next
  TotalSizeTestvb=str
End Function
</SCRIPT>

<DIV id=showvb class=show alt="°á°ú">°á°ú Ç¥½Ãâ</DIV>
<DIV class=show onClick="showvb.innerHTML=TotalSizeTestvb()">
  <SPAN class=ie>VBScript</SPAN> <SPAN class=property>TotalSize</SPAN> ¼Ó¼º ¿¹Á¦</DIV>