Scripting Runtime Library(FileSystemObject)

ÁöÁ¤ÇÑ µå¶óÀ̺êÀÇ ·çÆ® Æú´õ¸¦ ³ªÅ¸³»´Â Folder °³Ã¼¸¦ ¹ÝȯÇÑ´Ù.

Àμö
objec
ÇʼöÀûÀÎ ¿ä¼ÒÀ̸ç, object´Â Ç×»ó Drive °³Ã¼ÀÌ´Ù.

: (¼Ó¼º ¹®ÀÚ¿­)

¼Ó¼º°ª ValÀº µå¶óÀ̺êÀÇ ÃÖ»óÀ§ Æú´õ¸¦ ³ªÅ¸³»´Â ¹®ÀÚ¿­ÀÌ´Ù.

ÀÌ ¼Ó¼ºÀº ÀбâÀü¿ëÀÌ¸ç µðÆúÆ® °ªÀº ¾ø´Ù.

¼³¸í

ÁöÁ¤ÇÑ µå¶óÀ̺êÀÇ ·çÆ® Æú´õ(ÃÖ»óÀ§ Æú´õ)¸¦ ³ªÅ¸³»´Â Folder °³Ã¼¸¦ ¹ÝȯÇÑ´Ù. ÀбâÀü¿ëÀÌ´Ù.

¹ÝȯµÇ´Â Folder °³Ã¼¸¦ »ç¿ëÇÏ¸é µå¶óÀ̺꿡 µé¾îÀÖ´Â ¸ðµç ÆÄÀÏ°ú Æú´õ¿¡ ¾×¼¼½ºÇÒ ¼ö ÀÖ´Ù.


RootFolder ¼Ó¼º ¿¹Á¦

°á°ú Ç¥½Ãâ
JScript RootFolder ¼Ó¼º ¿¹Á¦
<SCRIPT language=JScript>
function RootFolderTest(drivePath){
  var fso,driveObj;
  fso=new ActiveXObject('Scripting.FileSystemObject');
  if (fso.DriveExists(drivePath)){
      driveObj=fso.GetDrive(drivePath);
      return('driveObj.RootFolder="'+driveObj.RootFolder+'"');
  } else return(false);
}
</SCRIPT>

<DIV id=showjs class=show alt="°á°ú">°á°ú Ç¥½Ãâ</DIV>
<DIV class=show
  onClick="showjs.innerHTML=RootFolderTest('C:\\')">
<SPAN class=ie>JScript</SPAN><SPAN class=property>RootFolder</SPAN> ¼Ó¼º ¿¹Á¦</DIV>

VBScript·Î ¹Ýº¹

°á°ú Ç¥½Ãâ
VBScript RootFolder ¼Ó¼º ¿¹Á¦
<SCRIPT language=VBScript>
Function RootFolderTestvb(drivePath)
  Dim fso,driveObj
  Set fso=CreateObject("Scripting.FileSystemObject")
  Set driveObj=fso.GetDrive(drivePath)
  RootFolderTestvb="driveObj.RootFolder='"&driveObj.RootFolder&"'"
End Function
</SCRIPT>

<DIV id=showvb class=show alt="°á°ú">°á°ú Ç¥½Ãâ</DIV>
<DIV class=show
  onClick="showvb.innerHTML=RootFolderTestvb('C:\\')">
<SPAN class=ie>VBScript</SPAN><SPAN class=property>RootFolder</SPAN> ¼Ó¼º ¿¹Á¦</DIV>