Does Windows have an executable that I can run in the command shell which returns the version number of an executable (.exe) file?
I see a lot of questions that sho
If you are willing and able to use PowerShell, the following code will work. If you are on a supported Windows system, PowerShell will be available.
(Get-Item -Path 'C:\Program Files\Java\jdk1.8.0_144\bin\java.exe').VersionInfo |
Format-List -Force
If you must run it in a cmd.exe shell, you could use:
powershell -NoLogo -NoProfile -Command ^
"(Get-Item -Path 'C:\Program Files (x86)\Java\jre1.8.0_201\bin\java.exe').VersionInfo |" ^
"Format-List -Force"