ÆÄÀÏÀ̳ª Æú´õÀÇ Çü½Ä¿¡ °üÇÑ Á¤º¸¸¦ ¹ÝȯÇÑ´Ù.
ÇʼöÀûÀÎ ¿ä¼ÒÀ̸ç, Ç×»ó object´Â File ¶Ç´Â Folder °³Ã¼ÀÌ´Ù.
ÀÌ ¼Ó¼ºÀº Àбâ/¾²±âÀÌ¸ç µðÆúÆ®°ªÀº ¾ø´Ù.
ÆÄÀÏÀ̳ª Æú´õÀÇ Çü½Ä¿¡ °üÇÑ Á¤º¸¸¦ ¹ÝȯÇÑ´Ù.
¿¹¸¦ µé¾î, FolderÀÇ °æ¿ì "ÆÄÀÏ Æú´õ"°¡, .TXT·Î ³¡³ª´Â ÆÄÀÏ¿¡ ´ëÇؼ´Â "ÅؽºÆ® ¹®¼"°¡ ¹ÝȯµÈ´Ù.
FileÀÇ °æ¿ì´Â È®ÀåÀÚ¿¡ µû¶ó Æú´õ ¿É¼Ç¿¡¼ ¼³Á¤µÇ¾î ÀÖ´Â ³»¿ëÀÇ Çü½ÄÀ» ¹ÝȯÇÑ´Ù.
<SCRIPT language=JScript> function TypeTest(folderPath){ var fso,fileObj,str; fso=new ActiveXObject('Scripting.FileSystemObject'); folderObj=fso.GetFolder(folderPath); str='"'+folderObj+'"ÀÇ ÇϺΠFile µéÀº<OL>'; enumObj=new Enumerator(folderObj.Files); for (;!enumObj.atEnd();enumObj.moveNext()){ fileObj=enumObj.item(); str+='<LI>'+fileObj+' : '+fileObj.Type; } str+='</OL>'; return(str); } </SCRIPT> <DIV id=showjs class=show alt="°á°ú">°á°ú Ç¥½Ãâ</DIV> <DIV class=show onClick="showjs.innerHTML=TypeTest('C:\\JsTest\\')"> <SPAN class=ie>JScript</SPAN> C:\\JsTest\\ <SPAN class=property>Type</SPAN> ¼Ó¼º ¿¹Á¦</DIV> <DIV class=show onClick="showjs.innerHTML=TypeTest('C:\\My Documents\\')"> <SPAN class=ie>JScript</SPAN> C:\\My Documents\\ <SPAN class=property>Type</SPAN> ¼Ó¼º ¿¹Á¦</DIV> <DIV class=show onClick="showjs.innerHTML=TypeTest('C:\\Program Files\\')"> <SPAN class=ie>JScript</SPAN> C:\\Program Files\\ <SPAN class=property>Type</SPAN> ¼Ó¼º ¿¹Á¦</DIV>
<SCRIPT language=VBScript> Function TypeTestvb(folderPath) Dim fso,fileObj,str Set fso=CreateObject("Scripting.FileSystemObject") Set folderObj=fso.GetFolder(folderPath) Set allFiles=folderObj.Files str=str&"'"&folderObj&"'ÀÇ ÇϺΠFolder µéÀº<OL>" For Each file1 in allFiles str=str&"<LI>"&file1&" : "&file1.Type Next str=str&"</OL>" TypeTestvb=str End Function </SCRIPT> <DIV id=showvb class=show alt="°á°ú">°á°ú Ç¥½Ãâ</DIV> <DIV class=show onClick="showvb.innerHTML=TypeTestvb('C:\\JsTest\\')"> <SPAN class=ie>VBScript</SPAN> C:\\JsTest\\ <SPAN class=property>Type</SPAN> ¼Ó¼º ¿¹Á¦</DIV> <DIV class=show onClick="showvb.innerHTML=TypeTestvb('C:\\My Documents\\')"> <SPAN class=ie>VBScript</SPAN> C:\\My Documents\\ <SPAN class=property>Type</SPAN> ¼Ó¼º ¿¹Á¦</DIV> <DIV class=show onClick="showvb.innerHTML=TypeTestvb('C:\\Program Files\\')"> <SPAN class=ie>VBScript</SPAN> C:\\Program Files\\ <SPAN class=property>Type</SPAN> ¼Ó¼º ¿¹Á¦</DIV>