Scripting Runtime Library(FileSystemObject)

½ÇÁ¦ ·ÎÄà µå¶óÀ̺êÀ̳ª ³×Æ®¿öÅ© °øÀ¯ ¿µ¿ªÀÇ µå¶óÀÌºê ¹®ÀÚ¸¦ ¹ÝȯÇÑ´Ù.

Àμö
object : (°³Ã¼)

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

: (¼Ó¼º ¹®ÀÚ¿­)

¼Ó¼º°ªÀº ½ÇÁ¦ ·ÎÄà µå¶óÀ̺êÀ̳ª ³×Æ®¿öÅ© °øÀ¯ ¿µ¿ªÀÇ µå¶óÀ̺긦 ³ªÅ¸³»´Â ¹®ÀÚ¿­ÀÌ´Ù.

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

¼³¸í

½ÇÁ¦ ·ÎÄà µå¶óÀ̺êÀ̳ª ³×Æ®¿öÅ© °øÀ¯ ¿µ¿ªÀÇ µå¶óÀÌºê ¹®ÀÚ¸¦ ¹ÝȯÇÑ´Ù.

³×Æ®¿öÅ© °øÀ¯ ¿µ¿ªÀÌ µå¶óÀÌºê ¹®ÀÚ¿¡ ¿¬°áµÇÁö ¾Ê´Â °æ¿ì¿Í °°ÀÌ ÁöÁ¤ÇÑ µå¶óÀ̺갡 µå¶óÀÌºê ¹®ÀÚ¿¡ ¿¬°áµÇÁö ¾ÊÀ¸¸é DriveLetter ¼Ó¼ºÀº ºó ¹®ÀÚ¿­("")À» ¹ÝȯÇÑ´Ù.



DriveLetter ¼Ó¼º ¿¹Á¦

°á°ú Ç¥½Ãâ
JScript DriveLetter ¼Ó¼º ¿¹Á¦
<SCRIPT language=JScript>
function DriveLetterTest(drivePath){
  var fso,driveObj,str;
  fso=new ActiveXObject('Scripting.FileSystemObject');
  driveObj=fso.GetDrive(fso.GetDriveName(drivePath));
  str='µå¶óÀ̺ê '+driveObj.DriveLetter.toUpperCase()+': - ';
  str+=driveObj.VolumeName+'<BR>';
  str+='»ç¿ë °¡´ÉÇÑ °ø°£: '+driveObj.AvailableSpace/1024+'KB<BR>';
  str+='FileSystem: '+driveObj.FileSystem;
  return(str);
}
</SCRIPT>

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

VBScript·Î ¹Ýº¹

°á°ú Ç¥½Ãâ
VBScript DriveLetter ¼Ó¼º ¿¹Á¦
<SCRIPT language=VBScript>
Function DriveLetterTestvb(drivePath)
  Dim fso,driveObj,str
  Set fso=CreateObject("Scripting.FileSystemObject")
  Set driveObj=fso.GetDrive(drivePath)
  str="µå¶óÀ̺ê "&driveObj.DriveLetter&": - "&driveObj.VolumeName&"<BR>"
  str=str&"»ç¿ë °¡´ÉÇÑ °ø°£: "&FormatNumber(driveObj.FreeSpace/1024,0)&" KB<BR>"
  str=str&"FileSystem:  "&driveObj.FileSystem
  DriveLetterTestvb=str
End Function
</SCRIPT>

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