Getting the version of an executable

Adobe / Reader
September 9, 2009 at 07:07:46
Specs: Windows XP, n/a
Hi, can anyone tell me how I can get the version of an executable programmatically. It can be a WSH script or a Win32 API executable, as long as I can access it in a batch file, for example like this:

for /f "delims=" %%a in ('getversion "%SystemRoot%\System32\reg.exe"') do set v=%%a

After that, I can check if %v% starts with "5.1" or "6.0" or "6.1".

I ask because I want to parse the output of a REG QUERY command in a batch file. Unfortunately, the output format differs with different versions of REG.EXE.


See More: Getting the version of an executable

Report •


#1
September 9, 2009 at 07:16:34
A good place to start looking for these things tends to be Sysinternals. Case in point: Sigcheck

Report •

#2
September 9, 2009 at 09:00:43
Thanks Razor, that does exactly what I asked for! I'm already a fan of various SysInternals utilities, but forgot about this one.

In the end, I realised that REG.EXE is part of Windows and will always have the same version number as the output of the VER command, so I used the latter.


Report •

Related Solutions


Ask Question