Is there any MS-DOS command to get the version of am executable (or dll) file?
-
3You're probably reffering to the Windows command-line. MS-DOS is dead for 15 years, and it didn't even support Portable Executable format, meaning command-line programs from Windows won't run under it. – himself Dec 17 '10 at 12:40
-
refer to http://stackoverflow.com/questions/3037008/assembly-version-from-command-line – L-Four Dec 17 '10 at 12:37
4 Answers
Of course there is a simple command ;-)
wmic /node:"servername" datafile where name='c:\\Program Files (x86)\\Symantec\\Symantec Endpoint Protection\\smc.exe' get version
you can ommit /node to perform check on the local computer. And if you ommit "get version" you get all the values and column names. Of course there are standard wmic parameters available like /output:filename, /append:filename or /format:csv and you can use @list.txt instead of a server name to perform check on list of machines.

- 272
- 1
- 17
-
Cool command, bro. Do you (or someone else) know how could I put the output of that command in a variable? That is, how can I set a variable to hold the version obtained by this command so that I can use it in other places inside my *.bat file? – Ulysses Alves Oct 03 '17 at 11:39
Either user powershell see Get file version in PowerShell
or Windows Explorer
or write your own utility, I don't think that MSDOS supports this natively.

- 1
- 1

- 419
- 3
- 6
You could load the executable as a binary file and read the PE headers manually...
http://www.microsoft.com/whdc/system/platform/firmware/PECOFF.mspx

- 1,212
- 5
- 14
- 29
You can try Resource Hacker with the following syntax:
reshack.exe -extract "path\to\my\file.dll," ver.rc, VERSIONINFO, , && findstr FILEVERSION ver.rc
Beware of commas. Make sure you can create ver.rc
.

- 76,634
- 23
- 210
- 236