Scripting Runtime Library(FileSystemObject)
ÁöÁ¤ÇÑ °æ·Î¿¡¼ ¸¶Áö¸· ±¸¼º ¿ä¼ÒÀÇ »óÀ§ Æú´õ À̸§À» Æ÷ÇÔÇÑ ¹®ÀÚ¿À» ¹ÝȯÇÑ´Ù.
¹Ýȯ°ª sValÀº ÇöÀç ¹®¼¿¡¼ ¼±ÅÃµÈ ¹®ÀÚ¿ÀÌ´Ù.
ÁöÁ¤ÇÑ °æ·Î¿¡¼ ¸¶Áö¸· ±¸¼º ¿ä¼Ò(Æú´õ³ª ÆÄÀÏ)ÀÇ »óÀ§ Æú´õ À̸§À» Æ÷ÇÔÇÑ ¹®ÀÚ¿À» ¹ÝȯÇÑ´Ù.
objPath Àμö¿¡ ÁöÁ¤ÇÑ ±¸¼º ¿ä¼ÒÀÇ »óÀ§ Æú´õ°¡ ¾øÀ¸¸é ºó ¹®ÀÚ¿("")À» ¹ÝȯÇÑ´Ù.
ÁÖÀÇ: GetParentFolderName ¸Þ¼µå´Â ÁÖ¾îÁø objPath ¹®ÀÚ¿¿¡¸¸ »ç¿ëÇÑ´Ù.
°æ·Î¸¦ °áÁ¤ÇÏÁöµµ ¾Ê°í ÁöÁ¤ÇÑ °æ·Î°¡ ÀÖ´ÂÁöµµ °Ë»çÇÏÁöµµ ¾Ê´Â´Ù.
<SCRIPT language=JScript> function GetParentFolderNameTest(folderPath){ var fso,str=''; fso=new ActiveXObject('Scripting.FileSystemObject'); str+='"'+folderPath+'"ÀÇ ParentFolder´Â<BR>"'+fso.GetParentFolderName(folderPath)+'" ÀÌ´Ù.<BR>'; return(str); } </SCRIPT> <DIV id=showjs class=show alt="°á°ú">°á°ú Ç¥½Ãâ</DIV> <DIV class=show onClick="showjs.innerHTML=GetParentFolderNameTest('C:\\JsTest\\test')"> <SPAN class=ie>JScript</SPAN> <SPAN class=method>GetParentFolderName</SPAN> ¸Þ¼µå ¿¹Á¦</DIV> <DIV class=show onClick="showjs.innerHTML=GetParentFolderNameTest(self.location)"> <SPAN class=ie>JScript</SPAN> ÇöÀç¹®¼ÀÇ <SPAN class=method>GetParentFolderName</SPAN> ¸Þ¼µå ¿¹Á¦</DIV>
<SCRIPT language=VBScript> Function GetParentFolderNameTestvb(folderPath) Dim fso,str Set fso=CreateObject("Scripting.FileSystemObject") str="'"&folderPath&"'ÀÇ ParentFolder´Â<BR>'"&fso.GetParentFolderName(folderPath)&"' ÀÌ´Ù.<BR>" GetParentFolderNameTestvb=str End Function </SCRIPT> <DIV id=showvb class=show alt="°á°ú">°á°ú Ç¥½Ãâ</DIV> <DIV class=show onClick="showvb.innerHTML=GetParentFolderNameTestvb('C:\\JsTest\\test')"> <SPAN class=ie>VBScript</SPAN> <SPAN class=method>GetParentFolderName</SPAN> ¸Þ¼µå ¿¹Á¦</DIV> <DIV class=show onClick="showvb.innerHTML=GetParentFolderNameTestvb(self.location)"> <SPAN class=ie>VBScript</SPAN> ÇöÀç¹®¼ÀÇ <SPAN class=method>GetParentFolderName</SPAN> ¸Þ¼µå ¿¹Á¦</DIV>