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.
This topic is 15 years and 11 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked
User avatar
usc2001
Posts: 3
Last visit: Thu Apr 10, 2008 12:55 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: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

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
Last visit: Thu Apr 10, 2008 12:55 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
Last visit: Thu May 29, 2008 5:08 am

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
Last visit: Thu May 29, 2008 5:08 am

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
Last visit: Thu Apr 10, 2008 12:55 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
Last visit: Mon Sep 28, 2020 1:20 pm

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
This topic is 15 years and 11 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked