3

Is there any MS-DOS command to get the version of am executable (or dll) file?

Keng
  • 52,011
  • 32
  • 81
  • 111
manolowar
  • 6,772
  • 5
  • 23
  • 18
  • 3
    You'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 Answers4

4

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.

McVitas
  • 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
1

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.

Community
  • 1
  • 1
Angus Connell
  • 419
  • 3
  • 6
1

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

oldSkool
  • 1,212
  • 5
  • 14
  • 29
1

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.

Benoit
  • 76,634
  • 23
  • 210
  • 236