File Versions information

Anything VBScript-related, including Windows Script Host, WMI, ADSI, and more.
Forum rules
Do not post any licensing information in this forum.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Locked
User avatar
usc2001
Posts: 3
Joined: Mon Mar 31, 2008 12:26 am

File Versions information

Post by usc2001 »

I'm wanting to be able to have an HTA read from another HTA and get file information such as version number. What are the best methods for doing this?

jvierra
Posts: 14550
Joined: Tue May 22, 2007 9:57 am
Contact:

File Versions information

Post by jvierra »

HTA files have no file version information. This is reserved for EXEs and DLL files or any file that is classified as an "executable' or "resource" along with a few other types.

An HTA file is a text file very similar to an HTML file.

If you mean that you need to read information out of a file then look into using the "FileSystemObject" with "ReadLine" and "InStr" to extract information.

jvierra2008-03-31 07:39:09

User avatar
usc2001
Posts: 3
Joined: Mon Mar 31, 2008 12:26 am

File Versions information

Post by usc2001 »

What method would you use to edit the file information on a standalone exe?

User avatar
donj
Posts: 416
Joined: Thu Nov 16, 2006 9:02 pm

File Versions information

Post by donj »

Depending on the Exe, modifying its header might also break a digital signature rendering the file useless.

User avatar
donj
Posts: 416
Joined: Thu Nov 16, 2006 9:02 pm

File Versions information

Post by donj »

The easiest way to get the version number is probably to use the WMI CIM_DataFile class or one of its derivatives.

User avatar
usc2001
Posts: 3
Joined: Mon Mar 31, 2008 12:26 am

File Versions information

Post by usc2001 »

That's only if the file is installed. If I'm checking the version of a script or a group of scripts compiled into an EXE then it won't work.

User avatar
abqbill
Posts: 138
Joined: Sat Apr 21, 2007 5:59 am

File Versions information

Post by abqbill »

Depending on the Exe, modifying its header might also break a digital signature rendering the file useless.Good point -- if the file is signed, modifying the resource will invalidate the signature.Bill

Locked