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

You need to ask Office 365 specific questions in the O365 deployment forum.  THey will point you at the current documentation and tools needed for deploying O365.

Note that you do not need too test the version.  Yhe update package does that when it is run. It will not update a version that is already at tat level or greater.

Free Windows Admin Tool Kit Click here and download it now
May 6th, 2015 3:53pm

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 18 hours 41 minutes ago
June 17th, 2015 8:30am

We would recommend not using batch files (shell scripts) to manage Office 365. First, because batch files are essentially obsolete now that we have PowerShell, and second, because Office 365 (as I understand it) has deployment tools already available.

Aside from these points, this forum isn't for "here's my script, can someone debug and fix it for me." This forum is for specific scripting questions.

Free Windows Admin Tool Kit Click here and download it now
June 17th, 2015 10:13am

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

Other recent topics Other recent topics