Scripting Runtime Library(FileSystemObject)

ÁöÁ¤ÇÑ µå¶óÀ̺곪 ³×Æ®¿öÅ© °øÀ¯ ¿µ¿ª¿¡¼­ »ç¿ëÀÚ°¡ »ç¿ëÇÒ ¼ö ÀÖ´Â °ø°£ÀÇ Å©±â¸¦ ¹ÝȯÇÑ´Ù.

Àμö
Drive : (°³Ã¼)

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

: (¼Ó¼º Á¤¼ö°ª)
¼Ó¼º°ªÀº ÁöÁ¤ÇÑ µå¶óÀ̺곪 ³×Æ®¿öÅ© °øÀ¯ ¿µ¿ª¿¡¼­ »ç¿ëÀÚ°¡ »ç¿ëÇÒ ¼ö ÀÖ´Â °ø°£ÀÇ Å©±â¸¦ byte ¼ö´ÜÀ§·Î ³ªÅ¸³»´Â Á¤¼ö°ªÀÌ´Ù.

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

¼³¸í

AvailableSpace ¼Ó¼ºÀÌ ¹ÝȯÇÏ´Â °ªÀº º¸Åë FreeSpace ¼Ó¼ºÀÌ ¹ÝȯÇÏ´Â °ª°ú °°´Ù.
±×·¯³ª ÇÒ´ç·®À» Áö¿øÇÏ´Â ÄÄÇ»ÅÍ ½Ã½ºÅÛ¿¡¼­´Â µÎ °ªÀÌ ¼­·Î ´Ù¸¦ ¼öµµ ÀÖ´Ù.



AvailableSpace ¼Ó¼º ¿¹Á¦

°á°ú Ç¥½Ãâ
Jscript AvailableSpace ¿¹Á¦
<SCRIPT language=JScript>
function AvailableSpaceTest(drivePath){
  var fso,driveObj,str;
  fso=new ActiveXObject('Scripting.FileSystemObject');
  driveObj=fso.GetDrive(fso.GetDriveName(drivePath));
  str='µå¶óÀ̺ê '+drivePath.toUpperCase()+' - '+driveObj.VolumeName+'<BR>';
  str+='»ç¿ë °¡´ÉÇÑ °ø°£: '+driveObj.AvailableSpace/1024+'KB';
  return(str);
}
</SCRIPT>

<DIV id=showjs class=show alt="°á°ú">°á°ú Ç¥½Ãâ</DIV>
<DIV class=show
  onClick="showjs.innerHTML=AvailableSpaceTest('C:\\')">
 <SPAN class=ie>Jscript</SPAN><SPAN class=property>AvailableSpace</SPAN> ¿¹Á¦</DIV>
°á°ú Ç¥½Ãâ
VBScript AvailableSpace ¿¹Á¦
<SCRIPT language=VBScript>
Function AvailableSpaceTestvb(drivePath)
  Dim fso,driveObj,str
  Set fso=CreateObject("Scripting.FileSystemObject")
  Set driveObj=fso.GetDrive(fso.GetDriveName(drivePath))
  str="µå¶óÀ̺ê "&UCase(drivePath)&" - "&driveObj.VolumeName&"<BR>"
  str=str&"»ç¿ë °¡´ÉÇÑ °ø°£: "&FormatNumber(driveObj.AvailableSpace/1024, 0)&" KB"
  AvailableSpaceTestvb=str
End Function
</SCRIPT>

<DIV id=showvb class=show alt="°á°ú">°á°ú Ç¥½Ãâ</DIV>
<DIV class=show
  onClick="showvb.innerHTML=AvailableSpaceTestvb('C:\\')">
 <SPAN class=ie>VBScript</SPAN><SPAN class=property>AvailableSpace</SPAN> ¿¹Á¦</DIV>