O.P. Get File Properties
Hello!
I'm trying to get properties of a file on computer.
(In particular Author and Description), so I wrote this:
var oWMI = GetObject("winmgmts:\\\\.\\root\\CIMV2");
var colFiles = oWMI.ExecQuery("Select * from Win32_FileSpecification WHERE Name='C:\\Windows\\notepad.exe'");
for(var colFile = new Enumerator(colFiles); !colFile.atEnd(); colFile.moveNext()) {
Debug.Trace(colFile.FileSize+" "+colFile.Description);
}
But it doesn't works. Maybe i'm using the wrong function?
I tried also:
var objFil = CreateObject("DSOFile.OleDocumentProperties");
objFil.Open("C:\antivir.exe");
Debug.Trace(objFil.SummaryProperties.Author);
with no results.
Can you help me doing this?
Thanks in advance!
|