Script to compare a version of office365 in windows registry with a version on the network folder

We have the below script which has been used to deploy Office365 updates via GPO, I am not sure what else to add in there so users could see some kind of progress or indication of updates are being installed

@echo off
REM *********************************************************************
REM Environment customization begins here. Modify variables below.
REM *********************************************************************
REM Set DeployServer to a network-accessible location containing the Office source files.
set DeployServer=\\contoso\c2r\Office365 update\

REM Set ConfigFile to the configuration file to be used for deployment (required)
set ConfigFile=\\contoso\c2r\Office365 update\Customconfig.xml

REM Set LogLocation to a central directory to collect script log files (install log files are set in XML file).
set LogLocation=C:\AppData\Local\Temp

REM *********************************************************************
REM Deployment code begins here.
REM *********************************************************************
REM Operating system is X64. Check for Office365 version in emulated propertyBag registry key
set Key=HKLM\SOFTWARE\Microsoft\Office\15.0\ClickToRun\PropertyBag
for /F "tokens=3" %%a in ('Reg query %Key% /v Version') do set Version=%%a
echo Version=%Version%
if "%Version%"=="15.0.4675.1002" (echo Office is up-to-date & goto :eof)

echo %date% %time% Setup started. >> %LogLocation%\%computername%.txt
echo start /wait %DeployServer%\setup.exe /configure %ConfigFile%
echo %date% %time% Setup ended with error code %errorlevel%. >> %LogLocation%\%computername%.txt

May 6th, 2015 12:47pm

I have a below script which reads the version of office365 from a registry value and compares it with the version given in the script. if the version if different to the version in the machine the script will run the setup and install the version given in the script

What i need it to do is to compare the version in the registry with the version on the network location e.g \\source\folder\Office365ClickToRun\Office\Data

Could someone please help in rectifying the below. Thank you

 @echo off
REM *********************************************************************
REM Environment customization begins here. Modify variables below.
REM *********************************************************************
REM Set DeployServer to a network-accessible location containing the Office source files.
set DeployServer=\\source\folder\Office365ClickToRun

REM Set ConfigFile to the configuration file to be used for deployment (required)
set ConfigFile=\\source\folder\Office365ClickToRun\deploy.xml

REM Set LogLocation to a central directory to collect script log files (install log files are set in XML file).
set LogLocation=\\source\folder\Office365ClickToRun\InstallLogs

REM *********************************************************************
REM Deployment code begins here.
REM *********************************************************************
REM Operating system is X64. Check for Office365 version in emulated propertyBag registry key
set Key=HKLM\SOFTWARE\Microsoft\Office\15.0\ClickToRun\PropertyBag
for /F "tokens=3" %%a in ('Reg query %Key% /v Version') do set Version=%%a
echo Version=%Version%
if "%Version%"=="15.0.4727.1002" (echo Office is up-to-date & goto :eof)
msg %username% Microsoft Office updates are being applied to your computer. Please do not attempt to restart or turn off your PC while this update is deployed as it could corrupt the program files.Thank you for your patience

echo %date% %time% Setup started. >> %LogLocation%\%computername%.txt
start /wait %DeployServer%\setup.exe /configure %ConfigFile%
echo %date% %time% Setup ended with error code %errorlevel%. >> %LogLocation%\%computername%.txt>> %LogLocation%\%computername%.txt

  • Edited by fzameen Tuesday, June 16, 2015 12:24 PM
Free Windows Admin Tool Kit Click here and download it now
June 16th, 2015 12:21pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics