Scripting Runtime Library(FileSystemObject)

·ÎÄà ÄÄÇ»ÅÍ¿¡ »ç¿ëÇÒ ¼ö ÀÖ´Â ¸ðµç Drive °³Ã¼·Î ±¸¼ºµÈ Drives Ä÷º¼ÇÀ» ¹ÝȯÇÑ´Ù.

Àμö
object : (°³Ã¼)

Ç×»ó FileSystemObjectÀÌ´Ù.

: (¼Ó¼º Ä÷º¼Ç)

·ÎÄà ÄÄÇ»ÅÍ¿¡ »ç¿ëÇÒ ¼ö ÀÖ´Â ¸ðµç Drive °³Ã¼·Î ±¸¼ºµÈ Drives Ä÷º¼ÇÀ» ¹ÝȯÇÑ´Ù.

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

¼³¸í

Enumerator °³Ã¼¿Í for ¹®Àåµî ·çÇÁ¹®ÀåÀ» »ç¿ëÇÏ¿© Drives Ä÷º¼ÇÀÇ ±¸¼º¿øµéÀ» ¹Ýº¹ ½ÇÇà½Ãų ¼ö ÀÖ´Ù.

À̵¿½Ä ¸Åü µå¶óÀ̺긦 Drives Ä÷º¼Ç¿¡ ³ªÅ¸³»±â À§ÇÏ¿© À̵¿½Ä ¸Åü µå¶óÀ̺꿡 ¸Åü¸¦ »ðÀÔÇÒ ÇÊ¿ä´Â ¾ø´Ù.



Drives ¼Ó¼º ¿¹Á¦

°á°ú Ç¥½Ãâ
JScript Drives ¿¹Á¦
<SCRIPT language=JScript>
function DrivesTest(){
  var fso,enumObj,enumObj,enum1,str='';
  fso=new ActiveXObject('Scripting.FileSystemObject');
  enumObj=new Enumerator(fso.Drives);
  for (; !enumObj.atEnd(); enumObj.moveNext()){
    enum1=enumObj.item();
    str=str+enum1.DriveLetter+' - ';
    if (enum1.DriveType==3) driveObj=enum1.ShareName;
    else if (enum1.IsReady) driveObj=enum1.VolumeName;
    else driveObj='[µå¶óÀ̺갡 ÁغñµÇÁö ¾Ê¾Ò´Ù.]';
    str+=driveObj+'<BR>';
  }
  return(str);
}
</SCRIPT>

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

VBScript·Î ¹Ýº¹

VBScript·Î °°Àº ³»¿ëÀ» For Each...Next ±¸Á¶¸¦ »ç¿ëÇÏ¿© Drives Ä÷º¼ÇÀÇ ±¸¼º¿øµéÀ» ¹Ýº¹ ½ÇÇà½ÃŲ ¿¹Á¦.

°á°ú Ç¥½Ãâ
VBScriptDrives ¿¹Á¦
<SCRIPT language=VBScript>
Function DrivesTestvb
  Dim fso,driveObj,drivesCol,driveVar,str
  Set fso=CreateObject("Scripting.FileSystemObject")
  Set drivesCol=fso.Drives
  For Each driveObj in drivesCol
    driveVar=""
    str=str&driveObj.DriveLetter&" - "
    If driveObj.DriveType=3 Then
      driveVar=driveObj.ShareName
    Elseif driveObj.IsReady Then
      driveVar=driveObj.VolumeName
    Else
      driveVar="[µå¶óÀ̺갡 ÁغñµÇÁö ¾Ê¾Ò´Ù.]"
    End If
    str=str&driveVar&"<BR>"
  Next
  DrivesTestvb=str
End Function
</SCRIPT>

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