Scripting Runtime Library(FileSystemObject)
ÁöÁ¤ÇÑ °æ·Î¿¡¼ µå¶óÀ̺꿡 ÇØ´çÇÏ´Â Drive °³Ã¼¸¦ ¹ÝȯÇÑ´Ù.
¹Ýȯ°ª oDriveÀº ÁöÁ¤ÇÑ °æ·Î¿¡¼ µå¶óÀ̺꿡 ÇØ´çÇÏ´Â Drive °³Ã¼¸¦ ¹ÝȯÇÑ´Ù.
³×Æ®¿öÅ© °øÀ¯¿¡¼´Â ³×Æ®¿öÅ© °øÀ¯ ¿µ¿ªÀÌ ÀÖ¾î¾ß ÇÑ´Ù.
drivePathÀÌ Çã¿ëµÈ ¾ç½Ä°ú ÀÏÄ¡ÇÏÁö ¾Ê°Å³ª drivePathÀÌ ¾øÀ¸¸é ¿À·ù°¡ ¹ß»ýÇÑ´Ù.
ÀÏ¹Ý °æ·Î ¹®ÀÚ¿·Î GetDrive ¸Þ¼µå¸¦ È£ÃâÇϸé drivePathÀ¸·Î »ç¿ëÇϱ⿡ ÀûÀýÇÑ ¹®ÀÚ¿À» °¡Á®¿Â´Ù.
<SCRIPT language=JScript> function GetDriveTest(drivePath){ var fso,driveObj,str=''; fso=new ActiveXObject('Scripting.FileSystemObject'); driveObj=fso.GetDrive(fso.GetDriveName(drivePath)); str='µå¶óÀ̺ê '+drivePath.toUpperCase()+' - '+driveObj.VolumeName+'<BR>'; str+='»ç¿ë °¡´ÉÇÑ °ø°£: '+driveObj.FreeSpace/1024+'KB'; return(str); } </SCRIPT> <DIV id=showjs class=show alt="°á°ú">°á°ú Ç¥½Ãâ</DIV> <DIV class=show onClick="id=showjs.innerHTML=GetDriveTest('C:\\')"> <SPAN class=ie>JScript</SPAN> <SPAN class=method>GetDrive</SPAN> ¸Þ¼µå ¿¹Á¦</DIV>
<SCRIPT language=VBScript> Function GetDriveTestvb(drivePath) Dim fso,driveObj,str Set fso=CreateObject("Scripting.FileSystemObject") Set driveObj=fso.GetDrive(fso.GetDriveName(drivePath)) str="µå¶óÀ̺ê "&UCase(drivePath)&" - "&driveObj.VolumeName&"<BR>" str=str&"»ç¿ë °¡´ÉÇÑ °ø°£: "&FormatNumber(driveObj.FreeSpace/1024,0)&" KB" GetDriveTestvb=str End Function </SCRIPT> <DIV id=showvb class=show alt="°á°ú">°á°ú Ç¥½Ãâ</DIV> <DIV class=show onClick="showvb.innerHTML=GetDriveTestvb('C:\\')"> <SPAN class=ie>VBScript</SPAN><SPAN class=method>GetDrive</SPAN> ¸Þ¼µå ¿¹Á¦</DIV>