Is there a way to check and return the version of an executable (.exe or .dll) file?
In windows, when you select such a file, and look at the properties, under "Details", most have a "File Version" (eg. 2.0.10.234).
I need a test that will be able to check that and return the version as a "reply". If possible, I would also need to check how the answer compares to a value I set (to check whether the version is older or newer than the set one)
Executable file version test
You may create Java or VB script and use this script with Active Script or Shell Script test methods
http://www.ks-soft.net/hostmon.eng/mfra ... htm#script
http://www.ks-soft.net/hostmon.eng/mfra ... m#chkShell
E.g. JScript for Shell Script test may look like
Compare version? "Version" is a text string, in general case it may be difficult to compare versions for various files. However if you need to check version of some specific file, its pretty easy to compare strings...
Regards
Alex
http://www.ks-soft.net/hostmon.eng/mfra ... htm#script
http://www.ks-soft.net/hostmon.eng/mfra ... m#chkShell
E.g. JScript for Shell Script test may look like
Code: Select all
statusOk = "ScriptRes:Ok:"
statusBad = "ScriptRes:Bad:"
statusUnknown = "ScriptRes:Unknown:"
var fso, filename, filever = "";
filename = "c:\\hostmon7\\hostmon.exe";
fso = new ActiveXObject("Scripting.FileSystemObject");
filever = fso.GetFileVersion(filename);
WScript.StdOut.Write(statusOk+':'+filever);
Regards
Alex