I'm asking what the best method to know if the office is installed or not on windows in batch?
So, i create this batch file to know which word version is installed !
My Question : Is there any method else in batch that you know to find out if office is installed on Windows and which version ?
@echo off
Title Check if Word Office is installed or Not ? And Which Version Number ?
@for /f "skip=2 tokens=3 delims=." %%a in (
'reg query "HKEY_CLASSES_ROOT\Word.Application\CurVer" /f App*'
) do (
Set "VerNumber=%%a.0"
)
SetLocal EnableDelayedExpansion
If defined VerNumber (
If [!VerNumber!] EQU [11.0] (Set "MSOffice=Office 2003")
If [!VerNumber!] EQU [12.0] (Set "MSOffice=Office 2007")
If [!VerNumber!] EQU [14.0] (Set "MSOffice=Office 2010")
If [!VerNumber!] EQU [15.0] (Set "MSOffice=Office 2013")
If [!VerNumber!] EQU [16.0] (Set "MSOffice=Office 2016+")
Color 0B & echo Word Application is installed ("!MSOffice!"^) (VerNumber="!VerNumber!"^)
) else (
Color 0C & echo Word Application is not installed ! & Timeout /T 3 /Nobreak>nul & Exit /B
)
EndLocal
Pause & Exit /B