Install Office 2013 Click to run from a BAT file

Hello All,

To install Office 2013 via SCCM 2012R2 I call the below bat program in "Deployment Type > Program > Installation program > Install_office365.bat".

The contents of the install folder gets downloaded to the users ccmcache folder and the install runs fine.

But because of the way the bat file is written will the install go back the the distribution point to install office instead of using the downloaded contain in the ccmcache folder.

---------------------------------------------------------------------------------------------------------

setlocal

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=\\dp.mydomain.com\Source\Software\Microsoft\Office365ProPlus\

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

set ConfigFile=\\dp.mydomain.com\Source\Software\Microsoft\Office365ProPlus\Install.xml
 
REM *********************************************************************

REM Deployment code begins here. Only modify Offscrub location below this line.

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

:DeployOffice

REM Uninstall Office 2010
call cscript \\dp.mydomain.com\Source\Software\Microsoft\Office365ProPlus\Office2010\Fixit\Offscrub10.vbs ProPlus /Bypass 1 /q /s /NoCancel

REM Close Outlook if it's opened
call cscript \\dp.mydomain.com\Source\Software\Microsoft\Office365ProPlus\CloseOutlookVerifyFailsafe.vbs

REM Install Office 2013
start /wait %DeployServer%\setup.exe /configure %ConfigFile%

:End

Endlocal

-----------------------------------------------------------------------------------------------------------------------------

Thank for your help

Tim

September 11th, 2015 6:11am

You can use %~dp0 in a batch file to point to the directory where the script was called from. 
Free Windows Admin Tool Kit Click here and download it now
September 11th, 2015 6:27am

See http://blog.configmgrftw.com/current-directory-in-configmgr-programs/ for details and a simple example.
September 11th, 2015 7:54am

That did the trick.

Thank you very much

Free Windows Admin Tool Kit Click here and download it now
September 11th, 2015 10:08am

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

Other recent topics Other recent topics