Scripting Runtime Library(FileSystemObject)

Folders Ä÷º¼Ç¿¡ »õ Æú´õ¸¦ Ãß°¡ÇÑ´Ù.

Àμö/ÆĶó¸ÞÅÍ
objectName : Folder
ÇʼöÀûÀÎ ¿ä¼ÒÀ̸ç, Ç×»ó Folders Ä÷º¼ÇÀÇ À̸§ÀÌ´Ù.
oVal
ÇʼöÀûÀÎ ¿ä¼ÒÀ̸ç, Ãß°¡ÇÒ »õ Folder °³Ã¼ÀÇ À̸§ÀÌ´Ù.
¼³¸í

oVal Æú´õ°¡ ÀÌ¹Ì Á¸ÀçÇÏ¸é ¿À·ù°¡ ¹ß»ýÇÑ´Ù.


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