Jump to content

FileGetVersion() returns outdated info - RESOLVED

Recommended Posts

I found a very old AutoIt script for obtaining file version information (Properties > Details items like the version string, product name, copyright, etc.). It didn't work very well, so I rewrote it after I discovered FileGetVersion().

The problem is that FileGetVersion() is returning outdated information that seems to belong to an old version of the file, long after the file has been deleted and recreated. Windows Explorer, on the other hand, shows up-to-date version info in the Properties > Details tab because (I think) it's accessing the cached file metadata and/or the latest version of the file. This looks similar to the Windows behavior in which (e.g.) the modification time for a previous incarnation of a file is still displayed by dir even after the file has been deleted and recreated. The timestamp is updated eventually, but in my case "eventually" is approaching infinity.

Is there a way in AutoIt to force retrieval of the latest file version properties? Failing that, is there some external method (like a command or admin setting) that can force Windows to return the latest version info when requested by a program?

Edited by tremolux66
Problem resolved

When the going gets tough, the tough start coding.

Link to post
Share on other sites


10 minutes ago, Jos said:

Did you check whether the file also exists in: %localappdata%\VirtualStore ?


No; not sure I understand the significance of that.

On the machine I'm developing & testing on, there are only a few folders and files in the %localappdata%\VirtualStore directory tree, and their modification times are a year or more ago. They're mostly from C:\Program Files and C:\Program Files (x86); nothing to do with the directories I'm working in (with my script's .exe and the files it's looking at).

When the going gets tough, the tough start coding.

Link to post
Share on other sites
  • Developers

The reason for the question was whether it is finding a different version of the file in the virtual store. That is the only reason I can think of why this could happen.

Another one is when checking files in certain directories like c:\windows\system32  in x64 or x86 mode can return different results.



SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
Live for the present,
Dream of the future,
Learn from the past.

Link to post
Share on other sites

Ah. Nope, my files aren't there.

Windows Explorer (Win 7 Enterprise) can locate old versions of the files I'm testing with and says the location is "Restore point". When I look at the Details tab on the previous version of the file, it's yet another version from what my FileGetVersion() script is reporting, e.g.,

  • Explorer reports file version = 2016.1.20.1 (correct)
  • My script reports file version = 2016.1.8.3
  • Explorer reports previous version's file version = 2016.1.8.4

The files I'm dumping the version info for are mostly AutoIt script .exe files; I use /fileversion Year.Month.Day.Iteration# when building my production code. (I also use /productname, /productversion, /legalcopyright, etc.) The build script deletes all the .exe files from the target directory before running Aut2Exe.

Edited by tremolux66
Reformat some of the text for readability (font).

When the going gets tough, the tough start coding.

Link to post
Share on other sites
  • 1 month later...

RESOLUTION: I got a new computer. It looks like the OS on my old computer must have been corrupted (somehow). I was seeing a lot of strange behavior w.r.t. an external CD/DVD/BD writer like: 4 drive letters instead of 1, write failures, a drive letter disappeared, regedit crashed when I was investigating the drive-letter issue (trying to back up the Registry), incredibly long load times for optical media, etc. Plus the weird problem described here with out-of-date file information returned by FileGetVersion().

I was issued a new computer, with a fresh OS image, and when I plugged in the optical writer it worked perfectly: 1 drive letter, no write errors, fast load times. It eventually occurred to me to retest my file info utility, and it worked perfectly (so far).

Go figure.

When the going gets tough, the tough start coding.

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By beautifulsoup
      Hi All,
      I'm not sure if its possible that I'm trying to achieve, I've looked into https://www.autoitscript.com/autoit3/scite/docs/SciTE4AutoIt3/AutoIt3Wrapper.html and such resources for help, but I cant really find the answer to my question.
      So upon compiling the script in SciTE, the exe file is given a Description under file Properties>Details. I understand, that  one can enter info manually there and it can even implement the version automatically with each compilation.
      What I'm trying to achieve is to somehow include the "@ScriptName" in the Details>File Description Field. But as I see no variable can be taken after "#" in this case.
      Do You think its achievable? (Win 10)
      Much obliged for taking time on reading this.
      Kind Regards,

    • By rudi
      the following script is running quite nicely for a friend of mine doing a year of work and travel to have a backup at home for all the pics and movies taken with her mobile phone,
      The facts:
      At home: a VMWARE virtual machine with dropbox installed for her DB account
      On-the-Road: One mobile phone, Camera Uploads are activated for her dropbox account, one Laptop.
      The idea is to have a copy of *ALL* pictures and movies taken with the mobile phone *OUTSIDE* the dropbox folder, so that the DB Max Size is never exceeded.
      The script is running at home and doing this:
      Copy all content from the "Camera Upload Folder" within the dropbox folder to some folder *OUTSIDE* the DB folder Move all content from the "Camera Upload Folder" do some other folder *INSIDE* the DB folder to indicate, that the backup copies at home were done successfully  
      Dropbox is also installed on the Laptop she has with her. So on the Laptop she checks from time to time the destination folder inside the dropbox folder and moves the pics / movies on the laptop to some other folder outside the dropbox as well. By that final step the images are moved out of the dropbox on the mobile phone as well, so that there is always space left to sync more pics / movies.
      As moving pics / movies out of the dropbox folder on the laptop doesn't touch the copies in the mobile phone's "Gallery", she has all the pics / movies at all three locations:
      Mobile Phone Laptop VM at home  
      The folder names propably are different for non-German localized Windows and Dropbox, just modify them to meet your localization.
    • By careca
      This is a folder backup tool, after i got tired of using tools made by others, that had either lack of functionality,
      or were overly complex, i decided to make my own, and this is it.
      MirrorDir mirrors dirs as the name says, simply select source and destination hit scan, review in the list if that's what you want it to do and press start copy.
      As this is a mirror sync tool, this means files that exist in destination but dont exist in source are marked for deletion.
      Other tools have other modes like the incrementing copy which does not delete anything, but i made this for me,
      only if there is a request i may think about adding features just for fun.
      Whats more? There's a save/load of profile and the profile is what contains the list of source and destination folders, these are kept in prefs.ini in folder MDir in local appdata.
      There are context menu's that allow for the removal of items from the profile list, either just for the list (in case you dont want to sync a specific folder, just this time)
      or delete from the list and the .ini .
      Best regards.
    • By ripdad
      Here is  another WMIC script that parses properties from various alias classes.
      Download:  WMIC_GET.au3
    • By ur
      How to get the thrid number of a file version.
      Example: Let's say I have a file with below properties.
      I want only the third number like here it is 1941 as highlighted.
      Is there any built in function to get it??

  • Create New...