Thursday, March 22, 2012

Win32 -- List binary files with version in a command line

for more about using JavaScript as a Win32 tool
http://noypi-linux.blogspot.com/2012/03/best-console-tool-is-javascript-tips.html

 --------------- begin code

var WshShell = new ActiveXObject("WScript.Shell");

var fso = new ActiveXObject("Scripting.FileSystemObject");
var dir = fso.GetFolder("c:\\");

var e = new Enumerator(dir.Files);
for (; !e.atEnd(); e.moveNext())
{
 var f = e.item();
 WScript.Echo('path: ' + f.path + '\tver:' + fso.GetFileVersion(f));
}