If Right$(file_name, 1) <> "\" Then file_name = file_name & "\"
txtFileName.Text = file_name & "Project1.exe"
End Sub
It works great but only gets the file info version of one specified file.
What is the code to go through all the files in a folder and print each file version on a seperate line?
Considering the age of the thread it is best to begin a new one stating your question, possibly linking back to this very old thread.
The problem is defining what you mean by "version" which can mean very different things for different kinds of files. There is no version attribute stored as part of the directory entry of a file. Some kinds of files do hold such a value internally, but when present it is stored differently for each type and so a different retrieval process is required.
The Windows Shell ("Explorer") knows how to extract such information for a few well-known MIME types, which is how it can display it for some files. It sounds like you are really asking how to obtain version info, which means we'd need to know what types of files you are asking about. There isn't any universal way to get this however.
Based on your question in this other thread you also dug up from the grave you are after what the Shell calls the "File Version" extended property. More specifically the version info that compilers and linkers record within PE files (EXE, DLL, etc.).
You can get this via the Shell's automation interfaces fairly easily, as well as by low-level API calls as illustrated in that other thread. However neither of these is "fast" since they both rely on reading data from the file to get it.
Here is an example created by extending an earlier demo I wrote to retrieve some image file extended properties:
So now you have two possible approaches. Applying either of them is just a matter of some very simple additional programming. Your post in the other thread is a bit disappointing in this regard. We don't do free custom programming here, but we're happy to help with questions.