Scripting Runtime Library(FileSystemObject)
Folders Ä÷º¼Ç¿¡ »õ Æú´õ¸¦ Ãß°¡ÇÑ´Ù.
oVal Æú´õ°¡ ÀÌ¹Ì Á¸ÀçÇÏ¸é ¿À·ù°¡ ¹ß»ýÇÑ´Ù.
<SCRIPT language=JScript> function AddTest(folderPath,newFolder){ var fso,folderObj,folderCol,newFolder,str=''; fso=new ActiveXObject('Scripting.FileSystemObject'); folderObj=fso.GetFolder(folderPath); folderCol=folderObj.SubFolders; if (newFolder=='') newFolder='C:\\JsTest\\','newFolder'; if (fso.FolderExists(folderPath+newFolder)) fso.DeleteFolder(folderPath+newFolder); newObj=folderCol.Add(newFolder); str+='"'+folderPath+'"¿¡ »õ·Î¿î Æú´õ "'+newObj+'"°¡ Ãß°¡µÇ¾ú´Ù.'; return(str); } </SCRIPT> <DIV id=showjs class=show alt="°á°ú">°á°ú Ç¥½Ãâ</DIV> <DIV class=show onClick="showjs.innerHTML=AddTest('C:\\JsTest\\','newFolder')"> <SPAN class=ie>JScript</SPAN> <SPAN class=method>Add</SPAN> ¸Þ¼µå ¿¹Á¦</DIV>
<SCRIPT language=VBScript> Function AddTestvb(folderPath,newFolder) Dim fso,folderObj,folderCol,newObj Set fso=CreateObject("Scripting.FileSystemObject") Set folderObj=fso.GetFolder(folderPath) Set folderCol=folderObj.SubFolders If newFolder="" Then newFolder="newFolder" End If If fso.FolderExists(folderPath&newFolder) Then fso.DeleteFolder(folderPath&newFolder) End If Set newObj=folderCol.Add(newFolder) AddTestvb="'"&folderPath&"'¿¡ »õ·Î¿î Æú´õ '"&newObj&"'°¡ Ãß°¡µÇ¾ú´Ù." End Function </SCRIPT> <DIV id=showvb class=show alt="°á°ú">°á°ú Ç¥½Ãâ</DIV> <DIV class=show onClick="showvb.innerHTML=AddTestvb('C:\\JsTest\\','newFolder')"> <SPAN class=ie>VBScript</SPAN> <SPAN class=method>Add</SPAN> ¸Þ¼µå ¿¹Á¦</DIV>