Scripting Runtime Library(FileSystemObject)
ÁÖ¾îÁø °æ·Î¿¡¼ Á¤È®ÇÑ Àüü °æ·Î¸¦ ¹ÝȯÇÑ´Ù.
¹Ýȯ°ª sValÀº Àý´ë ÁÖ¼Ò °æ·ÎÀÇ ¹®ÀÚ¿ÀÌ´Ù.
°æ·Î¸¦ ÁöÁ¤ÇÑ µå¶óÀ̺êÀÇ ·çÆ®¿¡¼ Àüü¸¦ ÂüÁ¶ÇÏ¸é ±× °æ·Î°¡ Á¤È®ÇÑ Àüü °æ·Î°¡ µÈ´Ù.
Àüü °æ·Î°¡ ¿¬°áµÈ µå¶óÀ̺êÀÇ ·çÆ® Æú´õ¸¦ ÁöÁ¤Çϸé Àüü °æ·Î´Â °æ·Î ±¸ºÐ ±âÈ£(\)·Î ³¡³ª¾ß ÇÑ´Ù.
ÇöÀç µð·ºÅ͸®¸¦c:\JsTest\test¶ó°í °¡Á¤ÇßÀ» ¶§ GetAbsolutePathname ¸Þ¼µå´Â ´ÙÀ½°ú °°´Ù.
objPath | GetAbsolutePathname |
---|---|
'c:' | 'c:\JsTest\test' |
'c:..' | 'c:\JsTest' |
'c:\\' | 'c:\' |
'c:testSub' | 'c:\JsTest\test\testSub' |
'CopyTest' | 'c:\JsTest\test\CopyTest' |
'c:\\..\\..\\JsTest' | 'c:\JsTest' |
<SCRIPT language=JScript> drivePath=GetDriveName(GetAbsolutePathname(Path)); </SCRIPT>
<SCRIPT language=JScript> function getAbsPath(objPath){ var fso,str=''; fso=new ActiveXObject('Scripting.FileSystemObject'); baseObj=fso.GetFolder('C:\\JsTest\\test'); str+=objPath+' : '+fso.GetAbsolutePathname(objPath)+'<BR>'; str+=objPath+' : '+fso.GetBaseName(objPath)+'<BR>'; str+=objPath+' : '+fso.GetSpecialFolder(objPath)+'<BR>'; return(str); } </SCRIPT> <DIV id=showjs class=show alt="°á°ú">°á°ú Ç¥½Ãâ</DIV> <DIV class=show onClick="showjs.innerHTML=getAbsPath('testcopy.txt')"> <SPAN class=ie>JScript</SPAN> 'testcopy.txt' <SPAN class=method>FileExist</SPAN> ¸Þ¼µå ¿¹Á¦</DIV> <DIV class=show onClick="showjs.innerHTML=getAbsPath('C:\\JsTest\\testfile.txt')"> <SPAN class=ie>JScript</SPAN> 'C:\\JsTest\\testfile.txt' <SPAN class=method>FileExist</SPAN> ¸Þ¼µå ¿¹Á¦</DIV>
<SCRIPT language=VBScript> drivePath=GetDriveName(GetAbsolutePathname(Path)) </SCRIPT>