Scripting Runtime Library(FileSystemObject)

ÁöÁ¤ÇÑ µå¶óÀ̺êÀÇ Çü½ÄÀ» ³ªÅ¸³»´Â °ªÀ» ¹ÝȯÇÑ´Ù.

Àμö
objec : (°³Ã¼)

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

: (¼Ó¼º Á¤¼ö°ª)

ÁöÁ¤ÇÑ µå¶óÀ̺êÀÇ Çü½ÄÀ» ³ªÅ¸³»´Â Á¤¼ö°ªÀ» ¹ÝȯÇÑ´Ù. Çü½ÄÀÇ °ªÀº ´ÙÀ½°ú °°´Ù.

¼Ó¼º°ªÇü½Äºñ°í
0 ¾Ë¼ö ¾øÀ½ Unknown
1 À̵¿½Ä Removable
2 °íÁ¤½Ä Fixed
3 ³×Æ®¿öÅ© Network
4 CD-ROM CD-ROM
5 RAM µð½ºÅ© RAM Disk

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


DriveType ¼Ó¼º ¿¹Á¦

°á°ú Ç¥½Ãâ
JScript DriveType ¼Ó¼º ¿¹Á¦
<SCRIPT language=JScript>
function DriveTypeTest(){
  var fso,driveObj,drvType,str='';
  fso=new ActiveXObject('Scripting.FileSystemObject');
  enumObj=new Enumerator(fso.Drives);
  for (; !enumObj.atEnd(); enumObj.moveNext()){
    driveObj=enumObj.item();
    switch (driveObj.DriveType){
      case 0: drvType='¾Ë ¼ö ¾øÀ½'; break;
      case 1: drvType='À̵¿½Ä'; break;
      case 2: drvType='°íÁ¤½Ä'; break;
      case 3: drvType='³×Æ®¿öÅ©'; break;
      case 4: drvType='CD-ROM'; break;
      case 5: drvType='RAM µð½ºÅ©'; break;
    }
    str+='µå¶óÀ̺ê '+driveObj.DriveLetter+': - '+drvType+'<BR>';
  }
  return(str);
}
</SCRIPT>

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

VBScript·Î ¹Ýº¹

°á°ú Ç¥½Ãâ
VBScript DriveType ¼Ó¼º ¿¹Á¦
<SCRIPT language=VBScript>
Function DriveTypeTestvb
  Dim fso,driveObj,drvType
  str=""
  Set fso=CreateObject("Scripting.FileSystemObject")
  Set drivesCol=fso.Drives
  For Each driveObj in drivesCol
    Select Case driveObj.DriveType
      Case 0: drvType="¾Ë ¼ö ¾øÀ½"
      Case 1: drvType="À̵¿½Ä"
      Case 2: drvType="°íÁ¤½Ä"
      Case 3: drvType="³×Æ®¿öÅ©"
      Case 4: drvType="CD-ROM"
      Case 5: drvType="RAM µð½ºÅ©"
    End Select
    str=str&"µå¶óÀ̺ê "&driveObj.DriveLetter&": - "&drvType&"<BR>"
  Next
  DriveTypeTestvb=str
End Function
</SCRIPT>

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