Deploying MS Office 2013 with GPO

I would like to deploy office 2013 via GPO, i finally have been able to get the script to work however there is one more detail i need to get figured out.... How can i incorporate into the script so that it will only run once...  my script is below and does the following, it uninstalls office 2010 whether it be 32bit or 64bit then silently installs office 2013 as a startup GPO... 

I need help on the best way to just "RUNONCE" any help would be greatly appreciated.

here is my script:

"C:\Program Files\Common Files\Microsoft Shared\OFFICE14\Office Setup Controller\setup.exe" /uninstall ProPlus /config "\\****\Office13\Uni_Office_10\SilentUninstall.xml"

"C:\Program Files (x86)\Common Files\Microsoft Shared\OFFICE14\Office Setup Controller\setup.exe" /uninstall ProPlus /config "\\****\Office13\Uni_Office_10\SilentUninstall.xml"

setlocal

REM ********************************************************************

REM Environment customization begins here. Modify variables below.

REM ********************************************************************

REM Get ProductName from the Office product's core Setup.xml file, and then add "office15." as a prefix.

set ProductName=Office15.PROPLUS

REM Set DeployServer to a network-accessible location containing the Office source files.

set DeployServer=\\****\Office13

REM Set ConfigFile to the configuration file to be used for deployment (required)

set ConfigFile=\\****\Office13\ProPlus.WW\config.xml

REM Set LogLocation to a central directory to collect log files.

set LogLocation=\\****\Office13\LogFiles

REM ********************************************************************

REM Deployment code begins here. Do not modify anything below this line.

REM ********************************************************************

IF NOT "%ProgramFiles(x86)%"=="" (goto ARP64) else (goto ARP86)

REM Operating system is X64. Check for 32 bit Office in emulated Wow6432 uninstall key

:ARP64

reg query HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432NODE\Microsoft\Windows\CurrentVersion\Uninstall%ProductName%

if NOT %errorlevel%==1 (goto End)

REM Check for 32 and 64 bit versions of Office 2010 in regular uninstall key.(Office 64bit would also appear here on a 64bit OS)

:ARP86

reg query HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall%ProductName%

if %errorlevel%==1 (goto DeployOffice) else (goto End)

REM If 1 returned, the product was not found. Run setup here.

:DeployOffice

echo %date% %time% %ComputerName% "Has Run the install Process" >> %LogLocation%\HasRunInstall.txt

start /wait %DeployServer%\setup.exe /config %ConfigFile%

echo %date% %time% %computername% Setup ended with error code %errorlevel%. >> %LogLocation%\FinishedInstall.txt

REM If 0 or other was returned, the product was found or another error occurred. Do nothing.

:End

Endlocal

April 6th, 2015 3:40pm

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

Other recent topics Other recent topics