Howtos:Deploy Office vbs on the agents with AD

From OCS Inventory NG
Jump to: navigation, search
@echo off
REM ********************************************************************************
REM **** Office plugin on agent install by GPO                                  ****
REM **** by Philippe BEAUMONT                                                   ****
REM **** You must use it in a logon computer script in your Active Directory    ****
REM ********************************************************************************

REM **** Please set here the version of the plugin you use.
REM **** Change it to upgrade the agent on all computer.
set VERSION=1

REM **** You must put here the address of your file server where Office.vbs is.
REM **** For exemple :
REM **** If Office.vbs is on \\filesserver\public\ocs\Office.vbs
REM **** you must put : fileserver\public\ocs
set INSTALLSERVER=fileserver\directory\directory_Where_Is_Office_Dot_vbs

IF %PROCESSOR_ARCHITECTURE%==x86 SET INSTALLDIR=%ProgramFiles%
IF %PROCESSOR_ARCHITECTURE%==AMD64 SET INSTALLDIR=%ProgramFiles(x86)%

IF NOT EXIST "%INSTALLDIR%\OCS Inventory agent\OCSInventory.exe" goto endend

IF EXIST "%INSTALLDIR%\OCS Inventory agent\Plugins\Office.vbs" goto upgrade

:install
xcopy \\%INSTALLSERVER%\Office.vbs "%INSTALLDIR%\OCS Inventory agent\Plugins\" /Y
cd "%INSTALLDIR%\OCS Inventory agent\"
echo pwouet > Office-%VERSION%.txt
goto endend

:upgrade
IF EXIST "%INSTALLDIR%\OCS Inventory agent\Office-%VERSION%.txt" goto endend
xcopy \\%INSTALLSERVER%\Office.vbs "%INSTALLDIR%\OCS Inventory agent\Plugins\" /Y
cd "%INSTALLDIR%\OCS Inventory agent\"
echo pwouet > Office-%VERSION%.txt

:endend