Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 03-20-2023, 02:29 AM
jerry.tom jerry.tom is offline Registry query for batch script Windows 10 Registry query for batch script Office 2019
Novice
Registry query for batch script
 
Join Date: Mar 2023
Posts: 1
jerry.tom is on a distinguished road
Default Registry query for batch script


I am trying to create a batch script, (only specifically batch script), to check if the latest Microsoft Office version is installed to my computer. If it detects the latest version, it will output hello, else it will output heyo. However, the if else statement doesn't seem to be working as I kept receiving the echo "heyo" even when the correct version of Office is installed.

Appreciate all the help I can get, thanks!

Script:

@echo off

for /f "skip=1 tokens=3 delims= " %%a in (
'reg query "HKEY_LOCALMACHINE\SOFTWARE\Microsoft\Office\Click ToRun\Configuration" /v VersionToReport'
) do (
set "VersionToReport=%%~a"
)

IF "%VersionToReport%" EQU "16.0.10396.20023" (
echo hello
) else (
echo heyo
)
Reply With Quote
Reply

Tags
batch, script

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Registry query for batch script Batch applying a macro to remove Header and Footer using Batch Auto Addin Edszx Word VBA 2 05-27-2019 11:16 PM
Registry issue GaryTayman Windows 1 07-19-2017 01:37 AM
Proofing Registry Keys Help mrrob941 Word 0 10-22-2016 12:27 PM
Query and Power Query not working Excel 2016 bl10 Excel 0 07-22-2016 06:25 PM
Registry query for batch script Remove Office XP entirely - registry? BridgeJ Office 1 01-13-2011 04:22 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 01:41 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft