Scripting Runtime Library(FileSystemObject)
ÁöÁ¤ÇÑ °æ·Î¿¡¼ Æú´õ¿¡ ÇØ´çÇÏ´Â Folder °³Ã¼¸¦ ¹ÝȯÇÑ´Ù.
¹Ýȯ°ª oFoler´Â folderPath·Î ÁöÁ¤µÈ À§Ä¡ÀÇ Æú´õ °³Ã¼ÀÌ´Ù.
ÁöÁ¤ÇÑ °æ·Î¿¡¼ Æú´õ¿¡ ÇØ´çÇÏ´Â Folder °³Ã¼¸¦ ¹ÝȯÇÑ´Ù.
ÁöÁ¤ÇÑ Æú´õ°¡ ¾øÀ¸¸é ¿À·ù°¡ ¹ß»ýÇÑ´Ù.
<SCRIPT language=JScript> function GetFolderTest(folderPath){ var fso,folderObj,folderCol,str=''; fso=new ActiveXObject('Scripting.FileSystemObject'); folderObj=fso.GetFolder(folderPath); enumObj=new Enumerator(folderObj.SubFolders); for (; !enumObj.atEnd();enumObj.moveNext()){ str+=enumObj.item()+'<BR>'; } return(str); } </SCRIPT> <DIV id=showjs class=show alt="°á°ú">°á°ú Ç¥½Ãâ</DIV> <DIV class=show onClick="id=showjs.innerHTML=GetFolderTest('C:\\JsTest')"> <SPAN class=ie>JScript</SPAN> C:\\JsTest <SPAN class=method>GetFolder</SPAN> ¸Þ¼µå ¿¹Á¦</DIV> <DIV class=show onClick="id=showjs.innerHTML=GetFolderTest('C:\\My Documents')"> <SPAN class=ie>JScript</SPAN> C:\\My Documents <SPAN class=method>GetFolder</SPAN> ¸Þ¼µå ¿¹Á¦</DIV>
<SCRIPT language=VBScript> Function GetFolderTestvb(folderPath) Dim fso,folderObj,folderCol str="" Set fso=CreateObject("Scripting.FileSystemObject") Set folderObj=fso.GetFolder(folderPath) Set foldersCol=folderObj.SubFolders For Each folderObj in foldersCol str=str&folderObj.Path&"<BR>" Next GetFolderTestvb=str End Function </SCRIPT> <DIV id=showvb class=show alt="°á°ú">°á°ú Ç¥½Ãâ</DIV> <DIV class=show onClick="showvb.innerHTML=GetFolderTestvb('C:\\JsTest')"> <SPAN class=ie>VBScript</SPAN> C:\\JsTest <SPAN class=method>GetFolder</SPAN> ¸Þ¼µå ¿¹Á¦</DIV> <DIV class=show onClick="showvb.innerHTML=GetFolderTestvb('C:\\My Documents')"> <SPAN class=ie>VBScript</SPAN> C:\\My Documents <SPAN class=method>GetFolder</SPAN> ¸Þ¼µå ¿¹Á¦</DIV>