Scripting Runtime Library(FileSystemObject)

ÁöÁ¤ÇÑ µå¶óÀ̺êÀÇ ³×Æ®¿öÅ© °øÀ¯ À̸§À» ¹ÝȯÇÑ´Ù.

Àμö
object : (°³Ã¼)

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

: (¼Ó¼º ¹®ÀÚ¿­)
¼Ó¼º°ªÀº ÁöÁ¤ÇÑ µå¶óÀ̺êÀÇ ³×Æ®¿öÅ© °øÀ¯ À̸§À» ³ªÅ¸³»´Â ¹®ÀÚ¿­ÀÌ´Ù.

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

Ư±â

³×Æ®¿öÅ© µå¶óÀ̺꿡¼­¸¸ °øÀ¯À̸§À» ¹ÝȯÇÏ°í,
objectName°¡ ³×Æ®¿öÅ© µå¶óÀ̺갡 ¾Æ´Ï¸é ShareName ¼Ó¼ºÀÌ ºó ¹®ÀÚ¿­("")À» ¹ÝȯÇÑ´Ù.


ShareName ¼Ó¼º ¿¹Á¦

°á°ú Ç¥½Ãâ
JScript ShareName ¼Ó¼º ¿¹Á¦
<SCRIPT language=JScript>
function ShareNameTest(){
  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+', ShareName=['+driveObj.ShareName+']<BR>';
  }
  return(str);
}
</SCRIPT>

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

VBScript·Î ¹Ýº¹

°á°ú Ç¥½Ãâ
VBScript ShareName ¼Ó¼º ¿¹Á¦
<SCRIPT language=VBScript>
Function ShareNameTestvb
  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&", ShareName=["&driveObj.ShareName&"]<BR>"
  Next
  ShareNameTestvb=str
End Function
</SCRIPT>

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