Scripting Runtime Library(FileSystemObject)

ÁöÁ¤ÇÑ ÆÄÀÏÀÇ ¹öÀü ¹øÈ£¸¦ ¹ÝȯÇÑ´Ù.

Àμö/ÆĶó¸ÞÅÍ
object
ÇʼöÀûÀÎ ¿ä¼ÒÀ̸ç, Ç×»ó FileSystemObjectÀÇ À̸§ÀÌ´Ù.
filePath
ÇʼöÀûÀÎ ¿ä¼ÒÀ̸ç, ÁöÁ¤ÇÑ ÆÄÀÏÀÇ °æ·Î(Àý´ë ¶Ç´Â »ó´ë °æ·Î)ÀÌ´Ù.
¹Ýȯ°ª

¹Ýȯ°ª sVersion´Â filePath·Î ÁöÁ¤µÈ À§Ä¡ÀÇ ÆÄÀÏÀÇ ¹öÀüÀ» ³ªÅ¸³»´Â ¹®ÀÚ¿­ÀÌ´Ù.

¼³¸í

ÁöÁ¤ÇÑ ÆÄÀÏÀÇ ¹öÀü ¹øÈ£¸¦ ¹ÝȯÇÑ´Ù.

filePathÀÌ ¸í¸íµÈ ±¸¼º ¿ä¼Ò·Î ³¡³ªÁö ¾ÊÀ¸¸é GetFileVersion ¸Þ¼­µå´Â ºó ¹®ÀÚ¿­("")À» ¹ÝȯÇÑ´Ù.

Âü°í: GetFileVersion ¸Þ¼­µå´Â ÁÖ¾îÁø °æ·Î ¹®ÀÚ¿­¿¡¸¸ »ç¿ëÇÑ´Ù.
°æ·Î¸¦ °áÁ¤ÇÏÁö ¾Ê°í ÁöÁ¤ÇÑ °æ·Î°¡ ÀÖ´ÂÁöµµ °Ë»çÇÏÁö ¾Ê´Â´Ù.

GetFileVersion ¸Þ¼­µå ¿¹Á¦

°á°ú Ç¥½Ãâ
JScript C:\\JsTest GetFileVersion ¸Þ¼­µå ¿¹Á¦
JScript C:C:\\Windows 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>
°á°ú Ç¥½Ãâ
VBScript C:\\JsTest GetFileVersion ¸Þ¼­µå ¿¹Á¦
VBScript C:\\Windows GetFileVersion ¸Þ¼­µå ¿¹Á¦
<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>