Scripting Runtime Library(FileSystemObject)

Æú´õ¸¦ ±âÁ¸ À§Ä¡¿¡¼­ ´Ù¸¥ À§Ä¡·Î ¹Ýº¹ º¹»çÇÑ´Ù.

Àμö/ÆĶó¸ÞÅÍ
objectName
ÇʼöÀûÀÎ ¿ä¼ÒÀ̸ç, Ç×»ó FileSystemObjectÀÇ À̸§ÀÌ´Ù.
source
ÇʼöÀûÀÎ ¿ä¼ÒÀ̸ç, º¹»çÇÒ Çϳª ÀÌ»óÀÇ Æú´õ¿¡ ´ëÇÑ ¹®ÀÚ¿­ Æú´õÀÌ´Ù. ¿ÍÀϵåÄ«µå ¹®ÀÚ¸¦ »ç¿ëÇÒ ¼ö ÀÖ´Ù.

¿ÍÀϵåÄ«µå ¹®ÀÚ(*)´Â source ÀμöÀÇ ¸¶Áö¸· °æ·Î ±¸¼º ¿ä¼Ò¿¡¸¸ »ç¿ëÇÒ ¼ö ÀÖ´Ù.

destination
ÇʼöÀûÀÎ ¿ä¼ÒÀ̸ç, Æú´õ¿Í sourceÀÇ ÇÏÀ§ Æú´õ¸¦ º¹»çÇÒ ¹®ÀÚ¿­ ´ë»óÀÌ´Ù. ¿ÍÀϵåÄ«µå ¹®ÀÚ´Â »ç¿ëÇÒ ¼ö ¾ø´Ù.
overwrite
¼±ÅÃÀûÀÎ ¿ä¼ÒÀ̸ç, ±âÁ¸ Æú´õ¸¦ µ¤¾î¾µÁö ¿©ºÎ¸¦ ³ªÅ¸³»´Â ºÎ¿ï°ªÀÌ´Ù.
ºÎ¿ï°ªÀÌ trueÀ̸é ÆÄÀÏÀ» µ¤¾î¾²°í, falseÀÌ¸é µ¤¾î¾²Áö ¾Ê´Â´Ù. ±âº»°ªÀº trueÀÌ´Ù.
¼³¸í

source¿¡ ¿ÍÀϵåÄ«µå ¹®ÀÚ¸¦ »ç¿ëÇϰųª destinationÀÌ °æ·Î ±¸ºÐ ±âÈ£(\)·Î ³¡³ª¸é destinationÀº ÀÏÄ¡ÇÏ´Â Æú´õ¿Í ÇÏÀ§ Æú´õ¸¦ º¹»çÇÒ ±âÁ¸ Æú´õ¸¦ ³ªÅ¸³½´Ù.
±×·¸Áö ¾ÊÀ¸¸é destinationÀº ¸¸µé·Á´Â Æú´õÀÇ À̸§À» ³ªÅ¸³½´Ù.
µÑ Áß ¾î´À °æ¿ì¶óµµ °³º° Æú´õ¸¦ º¹»çÇÒ ¶§ ¾Æ·¡ ³× °¡Áö °æ¿ì°¡ ÀϾ ¼ö ÀÖ´Ù.

¿ÍÀϵåÄ«µå ¹®ÀÚ¸¦ »ç¿ëÇÑ source¿Í ÀÏÄ¡ÇÏ´Â Æú´õ°¡ ¾øÀ¸¸é ¿À·ù°¡ ¹ß»ýÇÑ´Ù.

CopyFolder ¸Þ¼­µå´Â ù ¹ø° ¿À·ù°¡ ¹ß»ýÇÏ¸é ±× »óÅ·ΠÁßÁöÇÑ´Ù.
À̶§ ¿À·ù°¡ ¹ß»ýÇϱâ Àü¿¡ º¯°æµÈ »çÇ×Àº µÇµ¹¸± ¼ö ¾ø´Ù.


CopyFolder ¸Þ¼­µå ¿¹Á¦

°á°ú Ç¥½Ãâ
JScript 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>
°á°ú Ç¥½Ãâ
VBScript CopyFolder ¸Þ¼­µå ¿¹Á¦
<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>