Scripting Runtime Library¿¡¼ »ç¿ëÇÒ ¼ö ÀÖ´Â ¸ðµç µå¶óÀ̺êÀÇ Àбâ Àü¿ë Ä÷º¼ÇÀÌ´Ù.
[]=fsoName.Drives
Àбâ Àü¿ë Ä÷º¼ÇÀÌ´Ù.
mediaObj.Count·Î °¹¼ö¸¦ ¾Ë¼ö ÀÖ°í, .Item(keyVal)À¸·Î ÇØ´ç µå¶óÀ̺긦 ÂüÁ¶ÇÒ ¼ö ÀÖ´Ù.
Drives Ä÷º¼Ç¿¡ À̵¿½Ä ¸Åü µå¶óÀ̺긦 Ç¥½ÃÇϱâ À§ÇØ ±× µå¶óÀ̺꿡 ¸Åü¸¦ »ðÀÔÇÒ ÇÊ¿ä´Â ¾ø´Ù.
Drives Ä÷º¼Ç »ç¿ëÇÏ¿© µå¶óÀÌºê ¼Ó¼º¿¡ ¾×¼¼½ºÇÏ´Â ¿¹Á¦
Enumerator °³Ã¼¿Í for ¹®ÀåÀ» »ç¿ëÇÏ¿© ±× Ä÷º¼ÇÀ» ¹Ýº¹ ½ÇÇàÇÏ´Â ¹æ¹ýÀ» º¸¿©ÁØ´Ù.
<SCRIPT language=JScript> function colDrivesTest(){ var fso,driveName,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) driveName=enum1.ShareName ; else if (enum1.IsReady) driveName=enum1.VolumeName; else driveName='[µå¶óÀ̺갡 ÁغñµÇÁö ¾Ê¾Ò´Ù.]'; str+=driveName+'<BR>'; } return(str); } </SCRIPT> <DIV id=showjs class=show alt="°á°ú">°á°ú Ç¥½Ãâ</DIV> <DIV class=show onClick="id=showjs.innerHTML=colDrivesTest()"> <SPAN class=ie>JScript</SPAN> <SPAN class=collection>Drives</SPAN> Ä÷º¼Ç ¿¹Á¦</DIV>
VBScript·Î Files Ä÷º¼ÇÀ» °¡Á®¿Í¼ For Each...Next ¹®ÀåÀ» »ç¿ëÇÏ¿© µ¿ÀÏÇÑ ³»¿ëÀ» º¸¿©ÁØ´Ù.
<SCRIPT language=VBScript> Function colDrivesTestvb Dim fso,driveObj,drivecol,str,driveName Set fso=CreateObject("Scripting.FileSystemObject") Set drivecol=fso.Drives For Each driveObj in drivecol driveName="[µå¶óÀ̺갡 ÁغñµÇÁö ¾Ê¾Ò´Ù.]" str=str & driveObj.DriveLetter & " - " If driveObj.DriveType=3 Then driveName=driveObj.ShareName Elseif driveObj.IsReady Then driveName=driveObj.VolumeName End If str=str & driveName & "<BR>" Next colDrivesTestvb=str End Function </SCRIPT> <DIV id=showvb class=show alt="°á°ú">°á°ú Ç¥½Ãâ</DIV> <DIV class=show onClick="id=showvb.innerHTML=colDrivesTestvb()"> <SPAN class=ie>JScript</SPAN> <SPAN class=collection>Drives</SPAN> Ä÷º¼Ç ¿¹Á¦</DIV>
Drives Ä÷º¼Ç¿¡´Â ¸Þ¼µå°¡ ¾ø´Ù.