Link to home
Start Free TrialLog in
Avatar of Jonathan Mckee
Jonathan Mckee

asked on

Error when running Office 365 install via batch

Hi All, Ive got a batch file which runs at startup. It Assists in our migration of Office 2010 to 365 ProPlus (Locally installed).  When I run the batch it says /Config is an invalid switch and  'Setup Executed and ended with error Code 0', could someone be so kind as it look over the script and tell me that Im not going slowly mental. :) BTW Im far from a script expert so there may be mistakes in there!

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=\\catfish.com\netlogon\Office\Office15
 
REM Set ConfigFile to the configuration file to be used for deployment (required)
set ConfigFile=\\catfish.com\netlogon\Office\Office15\config.xml
 
REM Set LogLocation to a central directory to collect log files.
set LogLocation=\\catfish.com\netlogon\Office\Office15\InstallLogFiles
 
 
REM *********************************************************************
REM Deployment code begins here. Do not modify anything below this line.
REM *********************************************************************

REM Checks if office 365 is already installed, if so it skips to the end.

if exist "C:\Program Files\Microsoft Office 15\root\office15\OUTLOOK.EXE" goto End
 
REM Run setup here.
:DeployOffice
start /wait %DeployServer%\setup.exe /config %ConfigFile%
echo %date% %time% Setup executed and ended with error code %errorlevel%. >> %LogLocation%\%computername%.txt

REM This cscript called offscrub and removes all office 2010 programs due to ALL switch

cscript "\\catfish.com\netlogon\Office\OffScrub10.vbs" /ALL
 
REM If 0 or other was returned, the product was found or another error occurred. Do nothing.
:End
 
Endlocal
ASKER CERTIFIED SOLUTION
Avatar of Vasil Michev (MVP)
Vasil Michev (MVP)
Flag of Bulgaria image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial