ÁöÁ¤ÇÑ ÆÄÀÏ, Æú´õ, ¶Ç´Â µå¶óÀ̺êÀÇ °æ·Î¸¦ ¹ÝȯÇÑ´Ù.
ÇʼöÀûÀÎ ¿ä¼ÒÀ̸ç, object´Â Ç×»ó File, Folder, ¶Ç´Â Drive °³Ã¼ÀÌ´Ù.
ÀÌ ¼Ó¼ºÀº ÀбâÀü¿ëÀÌ¸ç µðÆúÆ®°ªÀº ¾ø´Ù.
µå¶óÀÌºê ¹®ÀÚ¿¡ ·çÆ® µå¶óÀ̺ê´Â Æ÷ÇÔµÇÁö ¾Ê´Â´Ù.
¿¹¸¦ µé¾î, C µå¶óÀ̺êÀÇ °æ·Î´Â C:\°¡ ¾Æ´Ï¶ó C:ÀÌ´Ù.
<SCRIPT language=JScript> function PathTest(filePath){ var fso,driveObj,fileObj,str; fso=new ActiveXObject('Scripting.FileSystemObject'); if (!fso.FileExists(filePath)){ // ¿À·ù ¹æÁö¸¦ À§ÇÏ¿© ÈÀÏÀÌ ¾øÀ¸¸é »ý¼ºÇÑ´Ù. fileObj=fso.OpenTextFile(filePath,2,true); fileObj.Write(filePath+' ÈÀÏ'); fileObj.Close(); } fileObj=fso.GetFile(filePath); str='File °æ·Î="'+fileObj.Path.toUpperCase()+'"<BR>'; folderObj=fileObj.ParentFolder; str+='ParentFolder °æ·Î="'+folderObj.Path.toUpperCase()+'"<BR>'; return(str); } </SCRIPT> <DIV id=showjs class=show alt="°á°ú">°á°ú Ç¥½Ãâ</DIV> <DIV class=show onClick="showjs.innerHTML=PathTest('C:\\JsTest\\expSample.txt')"> <SPAN class=ie>JScript</SPAN> <SPAN class=property>Path</SPAN> ¼Ó¼º ¿¹Á¦</DIV>
<SCRIPT language=VBScript> Function PathTestvb(filePath) Dim fso,driveObj,fileObj,str Set fso=CreateObject("Scripting.FileSystemObject") If Not fso.FileExists(filePath) Then ' ¿À·ù ¹æÁö¸¦ À§ÇÏ¿© ¿øº» ÈÀÏÀÌ ¾øÀ¸¸é »ý¼ºÇÑ´Ù. Set fileObj=fso.OpenTextFile(filePath,2,true) fileObj.Write filePath&" ÈÀÏ" fileObj.Close End If Set fileObj=fso.GetFile(filePath) str="File °æ·Î='"&UCase(fileObj.Path)&"'<BR>" Set folderObj=fileObj.ParentFolder str=str&"ParentFolder °æ·Î='"&UCase(folderObj.Path)&"'<BR>" PathTestvb=str End Function </SCRIPT> <DIV id=showvb class=show alt="°á°ú">°á°ú Ç¥½Ãâ</DIV> <DIV class=show onClick="showvb.innerHTML=PathTestvb('C:\\JsTest\\expSample.txt')"> <SPAN class=ie>VBScript</SPAN> <SPAN class=property>Path</SPAN> ¼Ó¼º ¿¹Á¦</DIV>