How to Detect Microsoft Office Version Name

1

1

Programmatically, what is a method that can get the name of the installed Microsoft Office version? I have tried every Powershell command, VBScript, and WMI query I could find. I have pored through the registry and the file system, and I can find no perfect method for collecting the installed Office version.

The closest method I was able to come up with was using a WMIC query:

wmic product where "Name like '%Office%'" get name,version

Unfortunately, this returns a varying array of applications and even if more finely filtered it doesn't tell me if "Office 16" is "Pro", "Professional Plus", or "Office365".

Otherwise, the registry value at

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\ClickToRun\Scenario\INSTALL\ProductstoAdd

exists at least on version 2016, but not with older versions. And it, itself, doesn't contain a friendly name so further scripting would be necessary to convert data of ProPlusRetail.16_en-us_x-none to "Office 2016 Professional Plus" or O365BusinessRetail.16_en-us_x-none to "Office 365 Business (2016)"

I'm hoping that someone has an easier methodology than a bunch of if/elseif/elseif statements in a huge script.

Beems

Posted 2016-10-28T23:36:41.363

Reputation: 1 067

Try something from this answer

– DrZoo – 2016-10-29T02:33:19.287

That methodology only returns the "Year" of the Office version. As noted, I need to determine further the product such as "Office 2016 Professional Plus" or "Office 365 Business (2016)". – Beems – 2016-10-31T12:49:04.557

http://superuser.com/questions/1097079/how-to-check-the-office-version-remotely This script seems pretty solid, however it doesnt tell you which license version is installed... – Kage – 2016-10-31T19:19:26.343

I looked at that one. Unfortunately, it does not determine the difference between "Office 2016 Professional Plus" and "Office 365 Business (2016)". Since this question was downvoted, I've been forced to write an entirely new detection script in Powershell that involves dozens and dozens of different mechanisms to get specific, named versions. – Beems – 2016-10-31T19:23:10.053

Answers

2

You can find a name of installed Microsoft Office in registry. The process may be automated following the steps:

Check the registry keys
for 32-bit versions:
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall
for 64-bit versions:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall

If a key matches one of the Product ID patterns, as per Description of the numbering scheme for product code GUIDs in Office 2016, 2013, 2010, 2007, 2003, XP, 2000, then read DisplayName Key Value, which is actually the name of installed Office.

Also I found Robust Office Inventory Scan Tool (ROISCAN), that performs quite full search for installed Microsoft Office versions.

omegastripes

Posted 2016-10-28T23:36:41.363

Reputation: 353

1Thanks! I did not realize the Office GUIDs were not randomized. That will definitely help with detection. – Beems – 2016-11-10T17:29:28.680

1

Try this:

setlocal enableDelayedExpansion
for /f "tokens=2 delims==" %%O in ('ftype ^|findstr /r /I "\\OFFICE[0-9]*" 2^>nul') do (
    set "verp=%%~O"
    goto :end_for
)
:end_for

for %%P in (%verp%) do (
    set "off_path=%%~dpP"
    for %%V in ("!off_path:~0,-1!") do (

     set "office_version=%%~nV"
     goto :end_for2
    )
)
:end_for2

if [%office_version%] == [] echo No Office installed & goto end
echo %office_version%

:end
endlocal

user1010151

Posted 2016-10-28T23:36:41.363

Reputation: 11

0

Another way (Office 2019) is you go:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\ProPlus2019Volume

Office2019-ProfessionalPlus

Leon Pedrosa

Posted 2016-10-28T23:36:41.363

Reputation: 1

0

As a possible option try this Poswershell query:

Get-ItemProperty HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\O365ProPlusRetail* | Select-Object DisplayName, DisplayVersion, Publisher

Suncatcher

Posted 2016-10-28T23:36:41.363

Reputation: 908