Scripting Runtime Library(FileSystemObject)

ÁöÁ¤ÇÑ µå¶óÀ̺êÀÇ º¼·ý À̸§À» ¼³Á¤Çϰųª ¹ÝȯÇÑ´Ù.

Àμö
objec

ÇʼöÀûÀÎ ¿ä¼ÒÀ̸ç, Ç×»ó Drive °³Ã¼ÀÇ À̸§ÀÌ´Ù.

¼±ÅÃÀûÀÎ ¿ä¼ÒÀ̸ç, »ç¿ëÇϸé Àº ÁöÁ¤ÇÑ Drive °³Ã¼ÀÇ »õ À̸§ÀÌ´Ù.

ÀÌ ¼Ó¼ºÀº Àбâ/¾²±âÀÌ¸ç µðÆúÆ®°ªÀº ¾ø´Ù.


VolumeName ¼Ó¼º ¿¹Á¦

°á°ú Ç¥½Ãâ
JScript VolumeName ¼Ó¼º ¿¹Á¦
<SCRIPT language=JScript>
function VolumeNameTest(){
  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.VolumeName+'] - '+driveObj.FreeSpace+' byte<BR>';
    else str+='Áغñ ¾ÈµÊ<BR>';
  }
  return(str);
}
</SCRIPT>

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

VBScript·Î ¹Ýº¹

°á°ú Ç¥½Ãâ
VBScript VolumeName ¼Ó¼º ¿¹Á¦
<SCRIPT language=VBScript>
Function VolumeNameTestvb()
  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.VolumeName&"] - "&driveObj.FreeSpace&" byte<BR>"
    Else str=str&"Áغñ ¾ÈµÊ<BR>"
    End If
  Next
  VolumeNameTestvb=str
End Function
</SCRIPT>

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