Scripting Runtime Library(FileSystemObject)

ÁöÁ¤ÇÑ Æú´õ¿¡ Æ÷ÇԵǾî ÀÖ´Â ¸ðµç Æú´õ·Î ±¸¼ºµÈ Folders Ä÷º¼ÇÀ» ¹ÝȯÇÑ´Ù.

objectName.SubFolders
Àμö
object
ÇʼöÀûÀÎ ¿ä¼ÒÀ̸ç, object´Â Ç×»ó Folder °³Ã¼ÀÌ´Ù.

: (¼Ó¼º Ä÷º¼Ç)
¼Ó¼º°ªÀº °³Ã¼ÀÇ ÇϺΠÆú´õµéÀ» ³ªÅ¸³»´Â Ä÷º¼ÇÀÌ´Ù.

ÁöÁ¤ÇÑ Æú´õ¿¡ Æ÷ÇԵǾî ÀÖ´Â ¸ðµç Æú´õ(¼û±è Ư¼º°ú ½Ã½ºÅÛ ÆÄÀÏ Æ¯¼ºÀÌ ¼³Á¤µÇ¾î ÀÖ´Â °Í Æ÷ÇÔ)·Î ±¸¼ºµÈ Folders Ä÷º¼ÇÀ» ¹ÝȯÇÑ´Ù.

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


SubFolders ¼Ó¼º ¿¹Á¦

< div class=example>
°á°ú Ç¥½Ãâ
JScript C:\\JsTest\\ SubFolders ¼Ó¼º ¿¹Á¦
JScript C:\\My Documents\\ SubFolders ¼Ó¼º ¿¹Á¦
JScript C:\\Program Files\\ SubFolders ¼Ó¼º ¿¹Á¦
<SCRIPT language=JScript>
function SubFoldersTest(folderPath){
  var fso,folderObj,enumObj,str='';
  fso=new ActiveXObject('Scripting.FileSystemObject');
  folderObj=fso.GetFolder(folderPath);
  str='"'+folderObj+'"ÀÇ ÇϺΠFolder µéÀº<OL>';
  enumObj=new Enumerator(folderObj.SubFolders);
  for (;!enumObj.atEnd();enumObj.moveNext()){
    str+='<LI>'+enumObj.item()+'<BR>';
  }
  str+='</OL>';
  return(str);
}
</SCRIPT>

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

VBScript·Î ¹Ýº¹

°á°ú Ç¥½Ãâ
VBScript C:\\JsTest\\ SubFolders ¼Ó¼º ¿¹Á¦
VBScript C:\\My Documents\\ SubFolders ¼Ó¼º ¿¹Á¦
VBScript C:\\Program Files\\ SubFolders ¼Ó¼º ¿¹Á¦
<SCRIPT language=VBScript>
Function SubFoldersTestvb(folderPath)
  Dim fso,folderObj,allfolders,folder1,str
  Set fso=CreateObject("Scripting.FileSystemObject")
  Set folderObj=fso.GetFolder(folderPath)
  Set allfolders=folderObj.SubFolders
  str=str&"'"&folderObj&"'ÀÇ ÇϺΠFolder µéÀº<OL>"
  For Each folder1 in allfolders
    str=str&"<LI>"&folder1.Path&"<BR>"
  Next
  str=str&"</OL>"
  SubFoldersTestvb=str
End Function
</SCRIPT>

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