Scripting Runtime Library(FileSystemObject)
Æú´õ¸¦ ±âÁ¸ À§Ä¡¿¡¼ ´Ù¸¥ À§Ä¡·Î ¹Ýº¹ º¹»çÇÑ´Ù.
¿ÍÀϵåÄ«µå ¹®ÀÚ(*)´Â source ÀμöÀÇ ¸¶Áö¸· °æ·Î ±¸¼º ¿ä¼Ò¿¡¸¸ »ç¿ëÇÒ ¼ö ÀÖ´Ù.
source¿¡ ¿ÍÀϵåÄ«µå ¹®ÀÚ¸¦ »ç¿ëÇϰųª destinationÀÌ °æ·Î ±¸ºÐ ±âÈ£(\)·Î ³¡³ª¸é destinationÀº ÀÏÄ¡ÇÏ´Â Æú´õ¿Í ÇÏÀ§ Æú´õ¸¦ º¹»çÇÒ ±âÁ¸ Æú´õ¸¦ ³ªÅ¸³½´Ù.
±×·¸Áö ¾ÊÀ¸¸é destinationÀº ¸¸µé·Á´Â Æú´õÀÇ À̸§À» ³ªÅ¸³½´Ù.
µÑ Áß ¾î´À °æ¿ì¶óµµ °³º° Æú´õ¸¦ º¹»çÇÒ ¶§ ¾Æ·¡ ³× °¡Áö °æ¿ì°¡ ÀϾ ¼ö ÀÖ´Ù.
¿ÍÀϵåÄ«µå ¹®ÀÚ¸¦ »ç¿ëÇÑ source¿Í ÀÏÄ¡ÇÏ´Â Æú´õ°¡ ¾øÀ¸¸é ¿À·ù°¡ ¹ß»ýÇÑ´Ù.
CopyFolder ¸Þ¼µå´Â ù ¹ø° ¿À·ù°¡ ¹ß»ýÇÏ¸é ±× »óÅ·ΠÁßÁöÇÑ´Ù.
À̶§ ¿À·ù°¡ ¹ß»ýÇϱâ Àü¿¡ º¯°æµÈ »çÇ×Àº µÇµ¹¸± ¼ö ¾ø´Ù.
<SCRIPT language=JScript> function CopyFolderTest(source,destination){ fso=new ActiveXObject('Scripting.FileSystemObject'); fso.CopyFolder(source,destination); str='"'+source+'"°¡ "'+destination+'"À¸·Î º¹»çµÇ¾ú´Ù.'; return(str); } </SCRIPT> <DIV id=showjs class=show alt="°á°ú">°á°ú Ç¥½Ãâ</DIV> <DIV class=show onClick="showjs.innerHTML= CopyFolderTest('C:\\JsTest\\test\\*','C:\\JsTest\\CopyTest\\')"> <SPAN class=ie>JScript</SPAN> <SPAN class=method>CopyFolder</SPAN> ¸Þ¼µå ¿¹Á¦</DIV>
<SCRIPT language=VBScript> Function CopyFolderTestvb(source,destination) Dim fso,folderObj Set fso=CreateObject("Scripting.FileSystemObject") fso.CopyFolder source,destination str="'"&source&"'°¡ '"&destination&"'À¸·Î º¹»çµÇ¾ú´Ù." CopyFolderTestvb=str End Function </SCRIPT> <DIV id=showvb class=show alt="°á°ú">°á°ú Ç¥½Ãâ</DIV> <DIV class=show onClick="showvb.innerHTML= CopyFolderTestvb('C:\\JsTest\\test\\*','C:\\JsTest\\CopyTest\\')"> <SPAN class=ie>VBScript</SPAN> <SPAN class=method>CopyFolder</SPAN> ¸Þ¼µå ¿¹Á¦</DIV>
<SCRIPT language=JScript> fso=new ActiveXObject("Scripting.FileSystemObject"); fso.CopyFolder("c:\\mydocuments\\*\\*","c:\\tempfolder\\") </SCRIPT>
<SCRIPT language=VBScript> Set fso=CreateObject("Scripting.FileSystemObject") fso.CopyFolder "c:\mydocuments\*\*","c:\tempfolder\" </SCRIPT>