Deploy Office 2016 using a script, from a network share!

In this article, I will show you how to setup a script to deploy Office 2016 Pro Plus w/Visio, from a network drive. This will save you time and effort.

Office 2016 will not install if you have fragments of older Office programs on the machine.

Please see the previous article : Script to Remove ALL Office Programs prior to deploying Office 2016 from a network location! This is a scripted way to speed up the uninstall process and reboot the users machine, prior to running this script.

There are two scripts that will be covered in two separate articles, you will find they work great together. First you UNINSTALL Office, then Second you INSTALL.

I’ve tested this process on a live domain, and have significantly reduced the time it takes to Remove previous Office versions and Deploy Office 2016 Pro Plus w/Visio.

Step 1 – Download Office 2016 Deployment Tool from Microsoft

This tool can be found here: Office 2016 Deployment Tool.

Filename: officedeploymenttool_7614-3602.exe

Step 2 – Run the executable

You will see the following:

deploymenttool1.png

Check the Terms box and hit continue.

Select the location for the extracted files. I chose DeploymentTool on the C: drive of my laptop.

After selecting the location, you will see:

deploymenttool2

You will see two files in the location:  Setup.exe and configuration.xml.

NOTE: This file has to be run under an Elevated Command Prompt, not just by clicking on exe file! Clicking on setup.exe does nothing.

deploymenttool3

Note: By default, Office 2016 Pro Plus installs Visio Pro, if you do not want Visio Pro, you can remove it from the Configuration.xml file.

Remove this from the Configuration.xml file, if you do not wish to install Visio Pro.
</Product>
<Product ID=”VisioProRetail”>
<Language ID=”en-us” />
</Product>

Special Note: When I setup this process, I downloaded the deployment tool to my laptop, so that I could run the deployment tool. Then (once all Office 2016 Pro files were downloaded), I copied the files to the Network Share labeled Office2016. 

Step 3 – Run Setup.exe under an Elevated Command Prompt

Open an Elevated Command Prompt on your system by right clicking Command Prompt and “Run as Administrator”. (or whatever way you open CMD)

Navigate to deployment tool folder holding the setup.exe and configuration.xml files.

You can type setup.exe to display the list of commands:

deploymenttool4.png

Run the following command from an Elevated Command Prompt, in the file location where you extracted the tool.

setup.exe /download configuration.xml

The Program will create an “Office” folder and download the necessary files into the folder, where you ran this tool.

deploymenttool5.png

You can see the “Office” folder has been created, with several folders and files inside of it.

deploymenttool6

It will take several minutes for these files to be downloaded. This will depend on your network speed.

 

Step  4 – Copy these folders and files to a Network Share

Copy these folders and files to a network location on the server of your choice. This folder on your network needs to be shared to everyone, so that users or your help desk staff can run the scripts from a user’s pc. I named my Network Share “OFFICE2016”, as I use this location for BOTH the UNINSTALL script and the INSTALL Office 2016 script.

An example of all the files in the network share are shown here:

networklocation

 

Step 5 – Modify the Office 2016 INSTALL Script to work in your environment

I placed this file in a share named “OFFICE2016” along with the files from this article.

@echo off

setlocal

::Store working directory to return after finished
set WORKDIR=%CD%

::Map and switch to a network drive and give it unmapped drive letter
pushd \\YOURSERVER_FQDN_or_IP\OFFICE2016\

::Store the name of the network drive so it can be unmapped when finished
Set NETDRIVE=%CD%
set NETDRIVE=%NETDRIVE:\=%

::Change back to the original directory
cd /d %WORKDIR%

::Run commands with the network drive mapped
%NETDRIVE%\setup.exe /configure

::Uncomment this to catch errors from the executable
::if %errorlevel% GTR o exit %errorlevel%

::Unmap the network drive
net use %NETDRIVE% /delete /y

endlocal

Save the script as a BAT file, I named mine “NETWORK-INSTALL-OFFICE-2016.BAT

The process of this script:

When you run this script, it will create a temporary network share on the user’s computer, install Office 2016 Pro Plus, then remove the temporary network share.

Step 6 – Run the script on a user’s PC!

Navigate to your OFFICE2016 network share and run the “Network-INSTALL-OFFICE-2016.bat“, as an administrator. And watch the magic 🙂

 

I attempted to run both the UNINSTALL and INSTALL script together, however the UNINSTALL requires a REBOOT, which is why the script in the other article reboots the PC.

I’m sure some genius can create a script to both Uninstall – reboot – then continue the Office 2016 install upon reboot, but for me this is where I stop.

My Real Time Test using this method are below:

 

Download the Office 2016 installer executable, and run = 45 minutes

Install Office 2016 using the script averages: 9 Minutes!

 

There are some errors that you may run into:

Error #1

This error was from a special case, that I noted in the UNINSTALL script. I ran a share folder off of a laptop, as a mobile file server. If you want to know more about this error, visit the article:Script to Remove ALL Office Programs prior to deploying Office 2016 from a network location!20170224_115229

Error #2

error2

Office Removal Tool did not get all the pieces. RE-RUN the 1st Script!

Error #3

error3

Office Removal Tool did not get all the pieces. RE-RUN the 1st Script!