Jump to content
EduGeek EdSec 2026 is Go! 27th Oct in Derby! Join us for a day of EdTech security focused talks, networking, and an evening social ×

Recommended Posts

Posted

Does anyone have a startup batch file to install Office 2013?

 

There was one (on Technet I think) for installing Office 2010 - I'll try just modifying that.

 

The official Deployment Guide for Office 2013 just tells you to write your own script. How hard would it have been to put an example in?

 

As far as I can see, it's the same process as for Office 2010: copy to administrative share, use the OCT to create MSP file in the /updates folder, use startup script to deploy. Except MS don't provide the script.

Posted

Thanks FN-GM, but I'd already seen that.

 

I tweaked the Office 2010 .bat file below.

 

The process for deploying Office 2013 is largely the same as 2010.

 

Unpack the .iso to an administrative share (the path and name must not contain spaces)

 

Run setup.exe /admin to run the OCT and create a .MSP file for silent install. Copy this file to the \updates\ folder.

 

Run the script, either manually or as a GPO startup script.

 

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=\\server\share\MS_Office_Professional_Plus_2013_32Bit

REM Set ConfigFile to the configuration file to be used for deployment (required)
set ConfigFile=\\server\share\MS_Office_Professional_Plus_2013_32Bit\ProPlus.WW\config.xml

REM Set LogLocation to a central directory to collect log files.
set LogLocation=\\server\share\MS_Office_Professional_Plus_2013_32Bit\Office2013LogFiles

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 2013 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
start /wait %DeployServer%\setup.exe /config %ConfigFile%
echo %date% %time% Setup ended with error code %errorlevel%. >> %LogLocation%\%computername%.txt

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

Endlocal

  • Thanks 2
  • 3 months later...
Posted

I've tried to use this script and other batch scripts to run the Office 2013 setup.exe via group policy - but it never actually initiates the installation. I can run the script when logged on as a administrative user - but the script will not run during the startup process.

 

When I perform an rsop.msc - I see that the script was executed. The install just doesn't kick off.

 

Not sure what I am missing. I've never had a problem deploying .msi packaged software.

 

I can look at the event logs and see that the computer I am testing is receiving the group policies,

 

Thanks FN-GM, but I'd already seen that.

 

I tweaked the Office 2010 .bat file below.

 

The process for deploying Office 2013 is largely the same as 2010.

 

Unpack the .iso to an administrative share (the path and name must not contain spaces)

 

Run setup.exe /admin to run the OCT and create a .MSP file for silent install. Copy this file to the \updates\ folder.

 

Run the script, either manually or as a GPO startup script.

 

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=\\server\share\MS_Office_Professional_Plus_2013_32Bit

REM Set ConfigFile to the configuration file to be used for deployment (required)
set ConfigFile=\\server\share\MS_Office_Professional_Plus_2013_32Bit\ProPlus.WW\config.xml

REM Set LogLocation to a central directory to collect log files.
set LogLocation=\\server\share\MS_Office_Professional_Plus_2013_32Bit\Office2013LogFiles

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 2013 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
start /wait %DeployServer%\setup.exe /config %ConfigFile%
echo %date% %time% Setup ended with error code %errorlevel%. >> %LogLocation%\%computername%.txt

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

Endlocal

  • 2 months later...
Posted

Is it possible to modify this batch script to display the computername. These logs files build up and its hard to determine which computer is getting the install.

 

Thanks,

  • 2 weeks later...
Posted

@skay: I don't know why it wouldn't run the installation whebn started from a startup script. If you've used the OCT to set it to do a silent installation there won't be any indication that it's running. Have you logged on and opened task manager for all users? There should be setup.exe or TrustedInstaller running.

 

The install can take 10-20 minutes.

 

@fch7227: if you're running it manually, you could add

echo %computername%

to it. If it's running as a startup script, then you won't see anything.

 

I also add

wuauclt /detectnow

to the end of it to speed up detecting updates from WSUS.

Posted

Thanks Overworked, I used your script as a starting point for Office365 setup and ended up with this:

 

setlocal

REM *********************************************************************
REM Environment customization begins here. Modify variables below.
REM *********************************************************************

REM Get ProductName  
set "ProductName=O365ProPlusRetail - en-us"

REM Set DeployServer to a network-accessible location containing the Office source files.
set DeployServer=\\*******\*****\*****\office15

REM Set ConfigFile to the configuration file to be used for deployment (required)
set ConfigFile=\\*******\*****\*****\office15\installconfiguration.xml

REM Set LogLocation to a central directory to collect log files.
set LogLocation=\\*******\*****\*****\office15\InstallLogFiles


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 2013 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% Deployment triggered on %computername%.>> %LogLocation%\%computername%.txt
start /wait %DeployServer%\setup.exe /configure %ConfigFile%
echo %date% %time% Setup executed and ended with error code %errorlevel%. >> %LogLocation%\%computername%.txt

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

Endlocal

 

Some observations from my testing and hair pulling:

 

1. The registry key created has spaces in the name (thanks MS), so the quotes are needed to get the check to work

 

2. The Office 365 setup switch is /configure - not /config (ditto)

 

3. It really does deploy silently. The first time I did it I thought nothing had happened and went away for 20 mins, only to find it in the start menu of the test system when I got back.

 

4. This will install alongside Office 2010 painlessly. Unfortunately it doesn't uninstall nicely (the uninstall message even recommends running Office 2010 repair!). You will have to repair 2010 if you uninstall 365/2013, and you may need to reactivate the 2010 installation as well.

 

5. Installation was approx 12 mins on a Win 7 test laptop.

 

It would have been nice if MS had put a suitable script in with the deployment instructions!

 

Regards all.

  • Thanks 1
Posted
Thanks Overworked, I used your script as a starting point for Office365 setup and ended up with this:

 

Some observations from my testing and hair pulling:

 

1. The registry key created has spaces in the name (thanks MS), so the quotes are needed to get the check to work

 

2. The Office 365 setup switch is /configure - not /config (ditto)

 

3. It really does deploy silently. The first time I did it I thought nothing had happened and went away for 20 mins, only to find it in the start menu of the test system when I got back.

 

4. This will install alongside Office 2010 painlessly. Unfortunately it doesn't uninstall nicely (the uninstall message even recommends running Office 2010 repair!). You will have to repair 2010 if you uninstall 365/2013, and you may need to reactivate the 2010 installation as well.

 

5. Installation was approx 12 mins on a Win 7 test laptop.

 

It would have been nice if MS had put a suitable script in with the deployment instructions!

 

Regards all.

 

Glad it's working. I didn't write the script - I found it somewhere else (I can't remember - Technet probably).

 

1. Also the file paths must not have spaces in them and putting quotes around them doesn't work. You may have to create a share with no spaces in it's path.

 

3. Got me confused for a while. I sometimes open Resource Monitor so I can see from a distance when it's finished and gone quiet. Or look in the log files folder.

 

4. It depends on the options created in the Office Customisation Tool. I set mine to uninstall previous versions, but sometimes it leaves traces of Office 2010 with differing effects.

  • 2 months later...
Posted
I have been doing this over the summer. Its certainly slow going ... anyway heres an article that may help people roll out office 2013. Explains the process of what to do to get a silent install on Office 2013 including editing the config.xml file and includes some of the error codes you might get. Hope its useful.
  • 3 weeks later...
Posted

Thanks OverWorked

 

I used the script to automate an install of Office 2013 to a test machine last week and it worked perfectly. It even allows a user to log in while it is installing. (I had visions of teachers and pupils switching on their machines and having to wait while the software installed!) At this very moment it is installing in one of our ICT suites. Now all I have to do is wait for the backlash from staff as they try to figure out how to use it!

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...