Scripting Runtime Library(FileSystemObject)
ÁöÁ¤ÇÑ Æú´õ°¡ ÀÖÀ¸¸é true¸¦, ±×·¸Áö ¾ÊÀ¸¸é false¸¦ ¹ÝȯÇÑ´Ù.
¹Ýȯ°ª bValÀº ÁöÁ¤ÇÑ Æú´õ°¡ Àִ°¡¸¦ ³ªÅ¸³»´Â ºÎ¿ï°ªÀÌ´Ù.
true | ÁöÁ¤ÇÑ Æú´õ°¡ ÀÖ´Ù. |
false | ÁöÁ¤ÇÑ Æú´õ°¡ ¾ø´Ù. |
<SCRIPT language=JScript> function FolderExistsTest(folderPath){ var fso,str='Æú´õ "'+folderPath+'" °¡ '; fso=new ActiveXObject('Scripting.FileSystemObject'); if (fso.FolderExists(folderPath)) str+=' ÀÖ´Ù.'; else str+=' ¾ø´Ù.'; return(str); } </SCRIPT> <DIV id=showjs class=show alt="°á°ú">°á°ú Ç¥½Ãâ</DIV> <DIV class=show onClick="showjs.innerHTML=FolderExistsTest('C:\\JsTest')"> <SPAN class=ie>JScript</SPAN> 'C:\\JsTest' <SPAN class=method>FolderExists</SPAN> ¸Þ¼µå ¿¹Á¦</DIV> <DIV class=show onClick="showjs.innerHTML=FolderExistsTest('C:\\JsTest\\test')"> <SPAN class=ie>JScript</SPAN> 'C:\\JsTest\\test' <SPAN class=method>FolderExists</SPAN> ¸Þ¼µå ¿¹Á¦</DIV>
<SCRIPT language=VBScript> Function FolderExistsTestvb(folderPath) Dim fso,str str="Æú´õ '"&folderPath&"'°¡ " Set fso=CreateObject("Scripting.FileSystemObject") If (fso.FolderExists(folderPath)) Then str=str&" ÀÖ´Ù." Else str=str&" ¾ø´Ù." End If FolderExistsTestvb=str End Function </SCRIPT> <DIV id=showvb class=show alt="°á°ú">°á°ú Ç¥½Ãâ</DIV> <DIV class=show onClick="showvb.innerHTML=FolderExistsTestvb('C:\\JsTest')"> <SPAN class=ie>VBScript</SPAN> 'C:\\JsTest' <SPAN class=method>FolderExists</SPAN> ¸Þ¼µå ¿¹Á¦</DIV> <DIV class=show onClick="showvb.innerHTML=FolderExistsTestvb('C:\\JsTest\\test')"> <SPAN class=ie>VBScript</SPAN> 'C:\\JsTest\\test' <SPAN class=method>FolderExists</SPAN> ¸Þ¼µå ¿¹Á¦</DIV>