I am trying to ensure that each Windows 7 receives a custom Outlook ribbon at logon.  How can I do this with the Kbox when offline script use the system account?  There are just 2 files that I need to copy to the users profile, and I can do this with an online script calling out xcopy ("C:\Users\%USERNAME%\AppData\Local\Microsoft\Office" /Y /D).  How can I pull this off at user logon?
 

Answer Summary:
Example for you: First: Install.cmd __________________________________________________________________________________ @echo off set AppName=Microsoft Office Oulook 2010 Quick Access Toolbar Customization 1.0 32bit (EN) - 001 :: Path for logfiles. set Logs=%SystemDrive%\Logs if exist %SystemDrive%\Wininst set Inst=%SystemDrive%\Wininst if exist %SystemDrive%\Vistainst set Inst=%SystemDrive%\Vistainst if exist %SystemDrive%\Srv08inst set Inst=%SystemDrive%\Srv08inst set Logs=%Inst%\Logs if not exist %Logs% MD %Logs% set LogFile=%Logs%\%AppName%.log set LogFinal=%Logs%\finalcheck.log :: Installation echo %date% %time% Installation (64 bit) of %AppName% >>"%LogFile%" cd /D %~dp0 if not exist "%LOCALAPPDATA%\Microsoft\Office\" md "%LOCALAPPDATA%\Microsoft\Office\" if exist "%LOCALAPPDATA%\Microsoft\Office\" copy /y "%~dp0olkexplorer.officeUI" "%LOCALAPPDATA%\Microsoft\Office\olkexplorer.officeUI" IF %ERRORLEVEL% EQU 3010 set ERRORLEVEL=0 IF %ERRORLEVEL% NEQ 0 goto Error :: Active Setup for Usersettings :ActiveSetup if not exist "%inst%\Active Setup" md "%inst%\Active Setup" if not exist "%inst%\Active Setup\%AppName%" md "%inst%\Active Setup\%AppName%" copy /y "%~dp0olkexplorer.officeUI" "%inst%\Active Setup\%AppName%\olkexplorer.officeUI" >>"%LogFile%" copy /y "%~dp0UserInstall.cmd" "%inst%\Active Setup\%AppName%\UserInstall.cmd" >>"%LogFile%" reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Active Setup\Installed Components\%AppName%" /v "StubPath" /t REG_SZ /d "\"%inst%\Active Setup\%AppName%\UserInstall.cmd\"" /f :: Errorhandler goto End :Error echo %date% %time% %AppName% >>"%LogFinal%" echo %date% %time% ERROR: %ERRORLEVEL% >>"%LogFile%" echo Error: %ERRORLEVEL% echo. :: End of Script :End echo %date% %time% End installation of %AppName% >>"%LogFile%" echo End __________________________________________________________________________________ Active Setup (UserInstall.cmd): ------------------------------------------------------------------------------------------------------------------------------------------ @echo off cd /D %~dp0 if exist "%LOCALAPPDATA%\Microsoft\Office\" copy /y "%~dp0olkexplorer.officeUI" "%LOCALAPPDATA%\Microsoft\Office\olkexplorer.officeUI" ------------------------------------------------------------------------------------------------------------------------------------------- The Active Setup will run once when the User Logs In. (It will run for each user on a machine) I hope this helps
Cancel
0 Comments   [ + ] Show Comments

Comments

Please log in to comment

Community Chosen Answer

2

Example for you:

First: Install.cmd

@echo off

set AppName=Microsoft Office Oulook 2010 Quick Access Toolbar Customization 1.0 32bit (EN) - 001

 

:: Path for logfiles.

set Logs=%SystemDrive%\Logs

if exist %SystemDrive%\Wininst set Inst=%SystemDrive%\Wininst

if exist %SystemDrive%\Vistainst set Inst=%SystemDrive%\Vistainst

if exist %SystemDrive%\Srv08inst set Inst=%SystemDrive%\Srv08inst

set Logs=%Inst%\Logs

if not exist %Logs% MD %Logs%

set LogFile=%Logs%\%AppName%.log

set LogFinal=%Logs%\finalcheck.log

 

:: Installation

echo %date% %time% Installation (64 bit) of %AppName% >>"%LogFile%"

cd /D %~dp0

if not exist "%LOCALAPPDATA%\Microsoft\Office\" md "%LOCALAPPDATA%\Microsoft\Office\"

if exist "%LOCALAPPDATA%\Microsoft\Office\" copy /y "%~dp0olkexplorer.officeUI" "%LOCALAPPDATA%\Microsoft\Office\olkexplorer.officeUI"

IF %ERRORLEVEL% EQU 3010 set ERRORLEVEL=0

IF %ERRORLEVEL% NEQ 0 goto Error


:: Active Setup for Usersettings

:ActiveSetup 

if not exist "%inst%\Active Setup" md "%inst%\Active Setup"

if not exist "%inst%\Active Setup\%AppName%" md "%inst%\Active Setup\%AppName%"

copy /y "%~dp0olkexplorer.officeUI" "%inst%\Active Setup\%AppName%\olkexplorer.officeUI" >>"%LogFile%"

copy /y "%~dp0UserInstall.cmd" "%inst%\Active Setup\%AppName%\UserInstall.cmd" >>"%LogFile%"

reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Active Setup\Installed Components\%AppName%" /v "StubPath" /t REG_SZ /d "\"%inst%\Active Setup\%AppName%\UserInstall.cmd\"" /f


:: Errorhandler

goto End

:Error

echo %date% %time% %AppName% >>"%LogFinal%"

echo %date% %time% ERROR: %ERRORLEVEL% >>"%LogFile%"

echo Error: %ERRORLEVEL%

echo.

 

:: End of Script

:End

echo %date% %time% End installation of %AppName% >>"%LogFile%"

echo End
 
Active Setup (UserInstall.cmd):
 
@echo off
cd /D %~dp0
if exist "%LOCALAPPDATA%\Microsoft\Office\" copy /y "%~dp0olkexplorer.officeUI" "%LOCALAPPDATA%\Microsoft\Office\olkexplorer.officeUI"
 
The Active Setup will run once when the User Logs In. (It will run for each user on a machine)
 
I hope this helps
Answered 09/24/2013 by: tecrumors
Sixth Degree Black Belt

Please log in to comment

Answers

0

If you are in a domain you can put this in the login script.

Answered 09/19/2013 by: SMal.tmcc
Red Belt

  • Or google active setup ;)
  • I appreciate the help, thank you very much.
Please log in to comment
Answer this question or Comment on this question for clarity