WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

File Operations

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

FileVerInfo Returns Incorrect Version

 Keywords:  FileVerInfo Returns Wrong Incorrect Not Correct Version Number String

Question:

I am creating a program that will scan certain software to see if it is current with patches. When I use FileVerInfo in the C:\Windows\system32 folder and point to an .exe or a .dll file then FileVerInfo returns the correct "FileVersion" info. If I try it against a .sys file it returns version information but it is not correct. The FileVerInfo function says it will work on any binary file. Is a .sys file considered a binary file?

Details: Winbatch 2012B on 32-bit only Windows 7 system.

Answer:

Yes it is a binary driver file.

Exes, dlls and driver files usually have at lease two different forms of version information stored in their version resource block. This is why the FileVerInfo function provides both: FileVersion and #FileVersion.

Try using '#FileVerInfo' instead.


Article ID:   W17873
Filename:   FilVerInfo Returns Incorrect Version.txt
File Created: 2012:11:26:14:28:38
Last Updated: 2012:11:26:14:28:38