Scripting Runtime Library(FileSystemObject)
ÁöÁ¤ÇÑ ÆÄÀÏÀÇ ¹öÀü ¹øÈ£¸¦ ¹ÝȯÇÑ´Ù.
¹Ýȯ°ª sVersion´Â filePath·Î ÁöÁ¤µÈ À§Ä¡ÀÇ ÆÄÀÏÀÇ ¹öÀüÀ» ³ªÅ¸³»´Â ¹®ÀÚ¿ÀÌ´Ù.
ÁöÁ¤ÇÑ ÆÄÀÏÀÇ ¹öÀü ¹øÈ£¸¦ ¹ÝȯÇÑ´Ù.
filePathÀÌ ¸í¸íµÈ ±¸¼º ¿ä¼Ò·Î ³¡³ªÁö ¾ÊÀ¸¸é GetFileVersion ¸Þ¼µå´Â ºó ¹®ÀÚ¿("")À» ¹ÝȯÇÑ´Ù.
Âü°í: GetFileVersion ¸Þ¼µå´Â ÁÖ¾îÁø °æ·Î ¹®ÀÚ¿¿¡¸¸ »ç¿ëÇÑ´Ù.
°æ·Î¸¦ °áÁ¤ÇÏÁö ¾Ê°í ÁöÁ¤ÇÑ °æ·Î°¡ ÀÖ´ÂÁöµµ °Ë»çÇÏÁö ¾Ê´Â´Ù.
<SCRIPT language=JScript> function GetFileVersionTest(filePath){ var fso,str=''; fso=new ActiveXObject('Scripting.FileSystemObject'); folderObj=fso.GetFolder(filePath); enumObj=new Enumerator(folderObj.Files); for (; !enumObj.atEnd(); enumObj.moveNext()){ fileObj=enumObj.item(); if (((filePath=='C:\\Windows')&&(fso.GetFileVersion(fileObj)))||(filePath!='C:\\Windows')){ str+=fileObj.Path+' : '; if (fso.GetFileVersion(fileObj)) str+=fso.GetFileVersion(fileObj); else str+='Á¤º¸ ¾øÀ½'; str+='<BR>'; } } return(str); } </SCRIPT> <DIV id=showjs class=show alt="°á°ú">°á°ú Ç¥½Ãâ</DIV> <DIV class=show onClick="id=showjs.innerHTML=GetFileVersionTest('C:\\JsTest')"> <SPAN class=ie>JScript</SPAN> C:\\JsTest <SPAN class=method>GetFileVersion</SPAN> ¸Þ¼µå ¿¹Á¦</DIV> <DIV class=show onClick="id=showjs.innerHTML=GetFileVersionTest('C:\\My Documents')"> <SPAN class=ie>JScript</SPAN> C:\\My Documents <SPAN class=method>GetFileVersion</SPAN> ¸Þ¼µå ¿¹Á¦</DIV>
<SCRIPT language=VBScript> Function GetFileVersionTestvb(folderPath) Dim fso,fileVersion str="" Set fso=CreateObject("Scripting.FileSystemObject") Set folderObj=fso.GetFolder(folderPath) Set filesCol=folderObj.Files For Each fileObj in filesCol fileVersion=fso.GetFileVersion(fileObj) If folderObj=fso.GetSpecialFolder(0) Then If Len(fileVersion)<>0 Then str=str&fileObj.Path&" : "&fileVersion&"<BR>" End If Else If Len(fileVersion)<>0 Then str=str&fileObj.Path&" : "&fileVersion&"<BR>" Else str=str&fileObj.Path&" : Á¤º¸ ¾øÀ½<BR>" End If End If Next GetFileVersionTestvb=str End Function </SCRIPT> <DIV id=showvb class=show alt="°á°ú">°á°ú Ç¥½Ãâ</DIV> <DIV class=show onClick="showvb.innerHTML=GetFileVersionTestvb('C:\\JsTest')"> <SPAN class=ie>VBScript</SPAN> C:\\JsTest <SPAN class=method>GetFileVersion</SPAN> ¸Þ¼µå ¿¹Á¦</DIV> <DIV class=show onClick="showvb.innerHTML=GetFileVersionTestvb('C:\\My Documents')"> <SPAN class=ie>VBScript</SPAN> C:\\My Documents <SPAN class=method>GetFileVersion</SPAN> ¸Þ¼µå ¿¹Á¦</DIV>