Though it is an old question, I'd try to answer it, as it may be useful for the others.
Windows command shell doesn't have a straight way to get file metadata like version but you can use wmic for it.
The main problem is that the display name of the software may be different in the properties of the installation/update exe file and than the one in the registry. So it is a bad idea to take the name from the file metadata and query for it in whole HKLM registry hive.
Also, if you do not have a predefined list of the software to be updated and do not know the exact path in the registry where version for each of them is stored, the idea to loop against the list of exe to get names from their metadata id also bad.
So, the best way to search for that is to make a script for each exe separately and to add them to Windows scheduler.
Here is an example of the required batch script to automate updates for Adobe Flash Player for 64-bit OS:
@echo off
for /f %%a in ('wmic datafile where name^="C:\\Users\\username\\Downloads\\install_flash_player_19_active_x.exe" get version ^| find /n /v "" ^| findstr "^\[2\]"') do set var=%%a
for /f "tokens=2 delims=]" %%a in ("%var%") do set prver=%%a
echo Available version: %prver%
for /f "tokens=3" %%a in ('reg query "HKLM\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{EE56217C-B3F9-402B-B4EC-63F090F51D3D}" /v DisplayVersion') do set regversion=%%a
echo Installed version: %regversion%
if %prver% == %regversion% (echo The newest version %regversion% installed) else (echo Update required & "C:\Users\username\Downloads\install_flash_player_19_active_x.exe")
Update file is located in some local folder, in my case C:\Users\username\Downloads\install_flash_player_19_active_x.exe. When programs are installed, they register themselves in
HKLM\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\ for 64-bot OS and
HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\ for 32-bit.
Hence, you need to find the path for every installation you need. Please note that {EE56217C-B3F9-402B-B4EC-63F090F51D3D} in my script is the GUID for the given version of Flash Player 19.
Here is the same in PowerShell which is more elegant:
$filever = (Get-Item "C:\Users\username\Downloads\install_flash_player_19_active_x.exe").versioninfo.fileversion
$appname = (Get-Item "C:\Users\username\Downloads\install_flash_player_19_active_x.exe").versioninfo.internalname
$regpath = "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{EE56217C-B3F9-402B-B4EC-63F090F51D3D}"
$regversion = Get-ItemProperty $regpath -Name "DisplayVersion" | select -ExpandProperty "DisplayVersion"
if ($winrarreg -eq $regversion) {
"The newest version of Flash Player $regpath is already installed"
} else {
"Current installed version is:" + $regversion
"Available version is:" + $filever
"Let's update Flash Player"
Start-Process -FilePath "C:\Users\username\Downloads\install_flash_player_19_active_x.exe"
}