Scripting Runtime Library(FileSystemObject)

ÁöÁ¤ÇÑ Æú´õ°¡ ÀÖÀ¸¸é true¸¦, ±×·¸Áö ¾ÊÀ¸¸é false¸¦ ¹ÝȯÇÑ´Ù.

Àμö/ÆĶó¸ÞÅÍ
object
ÇʼöÀûÀÎ ¿ä¼ÒÀ̸ç, Ç×»ó FileSystemObjectÀÇ À̸§ÀÌ´Ù.
folderPath
ÇʼöÀûÀÎ ¿ä¼ÒÀ̸ç, Æú´õ°¡ ÀÖ´ÂÁö ¿©ºÎ¸¦ È®ÀÎÇÒ Æú´õ À̸§ÀÌ´Ù.
Æú´õ°¡ ÇöÀç Æú´õ¿¡ ¾øÀ¸¸é Àüü °æ·Î(Àý´ë °æ·Î ¶Ç´Â »ó´ë °æ·Î)¸¦ Á¦°øÇØ¾ß ÇÑ´Ù.
¹Ýȯ°ª

¹Ýȯ°ª bValÀº ÁöÁ¤ÇÑ Æú´õ°¡ Àִ°¡¸¦ ³ªÅ¸³»´Â ºÎ¿ï°ªÀÌ´Ù.

true ÁöÁ¤ÇÑ Æú´õ°¡ ÀÖ´Ù.
false ÁöÁ¤ÇÑ Æú´õ°¡ ¾ø´Ù.

FolderExists ¸Þ¼­µå ¿¹Á¦

°á°ú Ç¥½Ãâ
JScript 'C:\\JsTest' FolderExists ¸Þ¼­µå ¿¹Á¦
JScript 'C:\\JsTest\\test' FolderExists ¸Þ¼­µå ¿¹Á¦
<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>
°á°ú Ç¥½Ãâ
VBScript 'C:\\JsTest' FolderExists ¸Þ¼­µå ¿¹Á¦
VBScript 'C:\\JsTest\\test' FolderExists ¸Þ¼­µå ¿¹Á¦
<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>