Scripting Runtime Library(FileSystemObject)
Çϳª ÀÌ»óÀÇ Æú´õ¸¦ ±âÁ¸ À§Ä¡¿¡¼ ´Ù¸¥ À§Ä¡·Î ¿Å±ä´Ù.
¹Ýȯ°ªÀº ¾ø´Ù.
Çϳª ÀÌ»óÀÇ Æú´õ¸¦ ±âÁ¸ À§Ä¡¿¡¼ ´Ù¸¥ À§Ä¡·Î ¿Å±ä´Ù.
source¿¡ ¿ÍÀϵåÄ«µå ¹®ÀÚ¸¦ »ç¿ëÇϰųª destinationÀÌ °æ·Î ±¸ºÐ ±âÈ£(\)·Î ³¡³ª¸é destinationÀº ÀÏÄ¡ÇÏ´Â ÆÄÀÏÀ» À̵¿ÇÒ ±âÁ¸ Æú´õ(Folder)¸¦ ³ªÅ¸³½´Ù.
±×·¸Áö ¾ÊÀ¸¸é destinationÀº ¸¸µé ´ë»ó Æú´õÀÇ À̸§À» ³ªÅ¸³½´Ù.
µÑ Áß ¾î´À °æ¿ì¶óµµ °³º° Æú´õ¸¦ À̵¿ÇÒ ¶§ ¾Æ·¡ ¼¼ °¡Áö Áß Çϳª°¡ ÀϾ ¼ö ÀÖ´Ù.
source¿¡ »ç¿ëÇÑ ¿ÍÀϵåÄ«µå ¹®ÀÚ¿Í ÀÏÄ¡ÇÏ´Â Æú´õ°¡ ¾ø¾îµµ ¿À·ù°¡ ¹ß»ýÇÑ´Ù.
MoveFolder ¸Þ¼µå´Â ù ¹ø° ¿À·ù°¡ ¹ß»ýÇÏ¸é ±× »óÅ·ΠÁßÁöÇÑ´Ù.
¿À·ù°¡ ¹ß»ýÇÏ°í ³ª¸é ÀÌÀü¿¡ º¯°æµÈ »çÇ×Àº µÇµ¹¸± ¼ö ¾ø´Ù.
Âü°í: ¿î¿µ üÁ¦°¡ Áö¿øÇÏ´Â °æ¿ì¿¡¸¸ ÀÌ ¸Þ¼µå¸¦ »ç¿ëÇÏ¿© º¼·ýµé °£¿¡ ÆÄÀÏÀ» ¿Å±æ ¼ö ÀÖ´Ù.
<SCRIPT language=JScript> function MoveFolderTest(folderPath,destination){ str=''; var fso=new ActiveXObject('Scripting.FileSystemObject'); if (!fso.FolderExists(folderPath)){ fso.CreateFolder(folderPath); str+='¿øº» Æú´õ°¡ ¾ø¾î '+folderPath+' Æú´õ¸¦ »ý¼ºÇÏ¿´´Ù.<BR>'; } if (!fso.FolderExists(destination)){ fso.CreateFolder(destination); str+='º¹»ç Æú´õ°¡ ¾ø¾î '+destination+' Æú´õ¸¦ »ý¼ºÇÏ¿´´Ù.<BR>'; } fso.MoveFolder(folderPath,destination); str+='¿øº» '+folderPath+' Æú´õ¸¦ '+destination+'À¸·Î À̵¿ÇÏ¿´´Ù.'; return(str); } </SCRIPT> <DIV id=showjs class=show alt="°á°ú">°á°ú Ç¥½Ãâ</DIV> <DIV class=show onClick="id=showjs.innerHTML= MoveFolderTest('C:\\JsTest\\MoveTest','C:\\JsTest\\MoveTarget')"> <SPAN class=ie>JScript</SPAN> <SPAN class=method>MoveFolder</SPAN> ¸Þ¼µå ¿¹Á¦</DIV>
<SCRIPT language=VBScript> Function MoveFolderTestvb(folderPath,destination) Dim fso str="" Set fso=CreateObject("Scripting.FileSystemObject") If Not fso.FolderExists(folderPath) Then fso.CreateFolder(folderPath) str=str&"¿øº» Æú´õ°¡ ¾ø¾î "&folderPath&" Æú´õ¸¦ »ý¼ºÇÏ¿´´Ù.<BR>" End If If fso.FolderExists(destination) Then fso.DeleteFolder(destination) str=str&"º¹»ç Æú´õ°¡ ÀÖ¾î "&destination&" Æú´õ¸¦ »èÁ¦ÇÏ¿´´Ù.<BR>" End If fso.MoveFolder folderPath,destination str=str&"¿øº» "&folderPath&" Æú´õ¸¦ "&destination&"À¸·Î À̵¿ÇÏ¿´´Ù." MoveFolderTestvb=str End Function </SCRIPT> <DIV id=showvb class=show alt="°á°ú">°á°ú Ç¥½Ãâ</DIV> <DIV class=show onClick="showvb.innerHTML= MoveFolderTestvb('C:\\JsTest\\MoveTest','C:\\JsTest\\MoveTarget')"> <SPAN class=ie>VBScript</SPAN> <SPAN class=method>MoveFolder</SPAN> ¸Þ¼µå ¿¹Á¦</DIV>