Scripting Runtime Library(FileSystemObject)
ÁöÁ¤ÇÑ µå¶óÀ̺갡 ÀÖÀ¸¸é true¸¦, ±×·¸Áö ¾ÊÀ¸¸é false¸¦ ¹ÝȯÇÑ´Ù.
¹Ýȯ°ª bValÀº ´ÙÀ½ Áß ÇϳªÀÇ ºÎ¿ï°ªÀÌ´Ù.
true | ÁöÁ¤ÇÑ µå¶óÀ̺갡 ÀÖ´Ù. |
false | ÁöÁ¤ÇÑ µå¶óÀ̺갡 ¾ø´Ù. |
À̵¿½Ä ¸Åü°¡ ÀÖ´Â µå¶óÀ̺꿡¼´Â ÇöÀç ¸Åü°¡ ¾ø¾îµµ DriveExists ¸Þ¼µå°¡ true °ªÀ» ¹ÝȯÇÑ´Ù.
µå¶óÀ̺갡 ÁغñµÇ¾ú´ÂÁöÀÇ ¿©ºÎ¸¦ È®ÀÎÇÏ·Á¸é Drive °³Ã¼ÀÇ IsReady ¼Ó¼ºÀ» »ç¿ëÇ϶ó.
<SCRIPT language=JScript> function DirveExistTest(drivePath){ var fso,str=''; fso=new ActiveXObject('Scripting.FileSystemObject'); if (fso.DriveExists(drivePath)) str+='µå¶óÀ̺ê '+drivePath+'ÀÌ(°¡) ÀÖ´Ù.'; else str+='µå¶óÀ̺ê '+drivePath+'ÀÌ(°¡) ¾ø´Ù.'; return(str); } </SCRIPT> <DIV id=showjs class=show alt="°á°ú">°á°ú Ç¥½Ãâ</DIV> <DIV class=show onClick="showjs.innerHTML=DirveExistTest('C:\\')"> <SPAN class=ie>JScript</SPAN> 'C:\' <SPAN class=method>DirveExist</SPAN> ¸Þ¼µå ¿¹Á¦</DIV> <DIV class=show onClick="showjs.innerHTML=DirveExistTest('X:\\')"> <SPAN class=ie>JScript</SPAN> 'X:\' <SPAN class=method>DirveExist</SPAN> ¸Þ¼µå ¿¹Á¦</DIV>
<SCRIPT language=VBScript> Function DirveExistTestvb(drivePath) Dim fso,str Set fso=CreateObject("Scripting.FileSystemObject") If fso.DriveExists(drivePath) Then str=("µå¶óÀ̺ê "&UCase(drivePath)&"ÀÌ(°¡) ÀÖ´Ù.") Else str=("µå¶óÀ̺ê "&UCase(drivePath)&"ÀÌ(°¡) ¾ø´Ù.") End If DirveExistTestvb=str End Function </SCRIPT> <DIV id=showvb class=show alt="°á°ú">°á°ú Ç¥½Ãâ</DIV> <DIV class=show onClick="showvb.innerHTML=DirveExistTestvb('C:\\')"> <SPAN class=ie>VBScript</SPAN> <SPAN class=method>DirveExist</SPAN> ¸Þ¼µå ¿¹Á¦</DIV> <DIV class=show onClick="showvb.innerHTML=DirveExistTestvb('X:\\')"> <SPAN class=ie>VBScript</SPAN> <SPAN class=method>DirveExist</SPAN> ¸Þ¼µå ¿¹Á¦</DIV>