Scripting Runtime Library(FileSystemObject)

ÁöÁ¤ÇÑ Æú´õ¿Í Æú´õÀÇ ³»¿ëÀ» »èÁ¦ÇÑ´Ù.

Àμö/ÆĶó¸ÞÅÍ
objectName
ÇʼöÀûÀÎ ¿ä¼ÒÀ̸ç, Ç×»ó FileSystemObjectÀÇ À̸§ÀÌ´Ù.
folderPath
ÇʼöÀûÀÎ ¿ä¼ÒÀ̸ç, »èÁ¦ÇÒ Æú´õÀÇ À̸§ÀÌ´Ù.
folderPathÀº ¸¶Áö¸· °æ·Î ±¸¼º ¿ä¼Ò¿¡ ¿ÍÀϵåÄ«µå ¹®ÀÚ¸¦ »ç¿ëÇÒ ¼ö ÀÖ´Ù.
force
¼±ÅÃÀûÀÎ ¿ä¼ÒÀ̸ç, trueÀ̸é Àбâ Àü¿ë Ư¼º ÁýÇÕÀ» °¡Áø Æú´õ¸¦ »èÁ¦ÇÏ°í,
false(±âº»°ª)ÀÌ¸é »èÁ¦ÇÏÁö ¾Ê´Â ºÎ¿ï°ªÀÌ´Ù.
¼³¸í

DeleteFolder ¸Þ¼­µå´Â ³»¿ëÀÌ ÀÖ´Â Æú´õ¿Í ³»¿ëÀÌ ¾ø´Â Æú´õ¸¦ ±¸º°ÇÏÁö ¾Ê´Â´Ù.
ÁöÁ¤ÇÑ Æú´õ´Â ³»¿ëÀÌ ÀÖµç ¾øµç »ó°ü¾øÀÌ »èÁ¦µÈ´Ù.

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

Delete ¸Þ¼­µå·Îµµ »èÁ¦ ÇÒ ¼ö ÀÖ´Ù.


DeleteFolder ¸Þ¼­µå ¿¹Á¦

°á°ú Ç¥½Ãâ
JScript DeleteFolder ¸Þ¼­µå ¿¹Á¦
<SCRIPT language=JScript>
function DeleteFolderTest(folderPath){
  var fso,fileObj,str='';
  fso=new ActiveXObject('Scripting.FileSystemObject');
  if (fso.FolderExists(folderPath)) fso.DeleteFolder(folderPath);
  fso.CreateFolder(folderPath);
  str+='Æú´õ "'+folderPath+'"°¡ »ý¼ºµÇ¾ú´Ù.<BR>';
  fso.DeleteFolder(folderPath);
  str+='Æú´õ "'+folderPath+'"°¡ »èÁ¦µÇ¾ú´Ù.';
  return(str);
}
</SCRIPT>

<DIV id=showjs class=show alt="°á°ú">°á°ú Ç¥½Ãâ</DIV>
<DIV class=show onClick="showjs.innerHTML=DeleteFolderTest('C:\\JsTest\\DeletFolder')">
  <SPAN class=ie>JScript</SPAN> <SPAN class=method>DeleteFolder</SPAN> ¸Þ¼­µå ¿¹Á¦</DIV>
°á°ú Ç¥½Ãâ
VBScript DeleteFolder ¸Þ¼­µå ¿¹Á¦
<SCRIPT language=VBScript>
Function DeleteFolderTestvb(folderPath)
  Dim fso
  Set fso=CreateObject("Scripting.FileSystemObject")
  If fso.FolderExists(folderPath) Then
    fso.DeleteFolder(folderPath)
  End If
  fso.CreateFolder(folderPath)
  str="Æú´õ '"&folderPath&"'°¡ »ý¼ºµÇ¾ú´Ù.<BR>"
  fso.DeleteFolder(folderPath)
  str=str&"Æú´õ '"&folderPath&"'°¡ »èÁ¦µÇ¾ú´Ù.<BR>"
  DeleteFolderTestvb=str
End Function
</SCRIPT>

<DIV id=showvb class=show alt="°á°ú">°á°ú Ç¥½Ãâ</DIV>
<DIV class=show onClick="showvb.innerHTML=DeleteTestvb('C:\\JsTest\\DeletFolder')">
  <SPAN class=ie>VBScript</SPAN> <SPAN class=method>Delete</SPAN> ¸Þ¼­µå ¿¹Á¦</DIV>