Re: Get a file's version in PHP
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.php archive

Re: Get a file's version in PHP

From: Janwillem Borleffs <jw@jwscripts.com>
Date: Sun Oct 30 2005 - 14:15:01 CET

Marius III wrote:
> No, I need to get the FileVersion.
> For example an EXE files version can be: 2.0.0.260 and a newer
> version of this EXE can be 2.0.0.269.
>

Since you are mentioning EXE files, I assume that you need this for a
Windows environment.

Here, you can use the COM extension (http://www.php.net/com) as follows:

<?php

//create FSO instance
$fso = new COM("Scripting.FileSystemObject")
 or die("Could not create Scripting.FileSystemObject");

$version = $fso->GetFileVersion(realpath('some.exe'));
print $version;

?>

JW
Received on Mon Nov 21 02:52:59 2005