Managing MS Office 2007 Quick Access Toolbar(s) with Roaming Profiles

by Jeremy Saunders on August 4, 2008

Hmmm…why oh why would Microsoft place the Office 2007 Quick Access Toolbar (.qat) files in the “%userprofile%\Local Settings\Application Data\Microsoft\Office” folder rather than the “%appdata%\Microsoft\Office” folder??? The “Local Settings” folder does not roam, nor would you want it to, so I don’t understand their thought process behind this one. The only real workaround is to use logon and logoff scripts to copy them into place. Refer to Microsoft Technet article KB926805 for further information.

Here are the scripts I have successfully used from a Group Policy Object (GPO) that copies these files to and from the users home (H:) drive. I don’t usually usually hard code the homedrive letter in scripts, and would have preffered to have used variables such as %HOMEDRIVE%%HOMEPATH%, but I didn’t have this luxury because it was in a Novell environment, and these variables are not automatically set to the correct places.

LoadQAT.cmd

@echo off
:: This script should be used as a logon script to copy the MS Office 2007 Quick Access Toolbar (.qat)
:: files to the users profile.
:: Access 2007  - Access.qat
:: Excel 2007  - Excel.qat
:: Outlook 2007  - Olkaddritem.qat, Olkapptitem.qat, Olkdistitem.qat, Olklogitem.qat
::    Olkmailitem.qat, Olkpostitem.qat, Olktaskitem.qat
:: PowerPoint 2007 - PowerPoint.qat
:: Word 2007  - Word.qat

:: Written by Jeremy@jhouseconsulting.com on 4th August 2008.

:: Modified by Jeremy@jhouseconsulting.com on 26th August 2008.
:: We needed to use a direct UNC path because the H: drive was not presented in time by the Novell logon script.
:: I also added a loop that to ensure the destination folder exists before the copy takes place.

SetLocal

Echo This is the LoadQAT Logfile for %username% >"%TEMP%\LoadQAT.log"

::IF NOT EXIST H:\NUL GOTO :END
IF NOT EXIST "\\Netncs_flpool01\Flvol01\Users\%username%" GOTO :END

::SET Office2007QuickAccessToolbarLocation=H:\System\MSOfficeQATFiles
SET Office2007QuickAccessToolbarLocation=\\Netncs_flpool01\Flvol01\Users\%username%\System\MSOfficeQATFiles
SET DefaultLocation=%USERPROFILE%\Local Settings\Application Data\Microsoft\Office

IF NOT EXIST "%Office2007QuickAccessToolbarLocation%" MD "%Office2007QuickAccessToolbarLocation%" >>"%TEMP%\LoadQAT.log"

:TestFolder
IF NOT EXIST "%DefaultLocation%" GOTO CreateFolder

xcopy /Y "%Office2007QuickAccessToolbarLocation%\*.qat" "%DefaultLocation%\" >>"%TEMP%\LoadQAT.log"

:END
EndLocal
Exit /b

:CreateFolder
MD "%DefaultLocation%" >>"%TEMP%\LoadQAT.log"
GOTO TestFolder

SaveQAT.cmd

@echo off
:: This script should be used as a logoff script to copy the MS Office 2007 Quick Access Toolbar (.qat)
:: files to the users home drive.
:: Access 2007  - Access.qat
:: Excel 2007  - Excel.qat
:: Outlook 2007  - Olkaddritem.qat, Olkapptitem.qat, Olkdistitem.qat, Olklogitem.qat
::    Olkmailitem.qat, Olkpostitem.qat, Olktaskitem.qat
:: PowerPoint 2007 - PowerPoint.qat
:: Word 2007  - Word.qat

:: Written by Jeremy@jhouseconsulting.com on 4th August 2008.

SetLocal

Echo This is the SaveQAT Logfile for %username% >"%TEMP%\SaveQAT.log"

IF NOT EXIST H:\NUL GOTO :END

SET Office2007QuickAccessToolbarLocation=H:\System\MSOfficeQATFiles
SET DefaultLocation=%USERPROFILE%\Local Settings\Application Data\Microsoft\Office

IF NOT EXIST "%Office2007QuickAccessToolbarLocation%" MD "%Office2007QuickAccessToolbarLocation%" >>"%TEMP%\SaveQAT.log"

xcopy /Y "%DefaultLocation%\*.qat" "%Office2007QuickAccessToolbarLocation%\" >>"%TEMP%\SaveQAT.log"

:END
EndLocal
Exit /b
Jeremy Saunders

Jeremy Saunders

Technical Architect | DevOps Evangelist | Software Developer | Microsoft, NVIDIA, Citrix and Desktop Virtualisation (VDI) Specialist/Expert | Rapper | Improvisor | Comedian | Property Investor | Kayaking enthusiast at J House Consulting
Jeremy Saunders is the Problem Terminator. He is a highly respected IT Professional with over 35 years’ experience in the industry. Using his exceptional design and problem solving skills with precise methodologies applied at both technical and business levels he is always focused on achieving the best business outcomes. He worked as an independent consultant until September 2017, when he took up a full time role at BHP, one of the largest and most innovative global mining companies. With a diverse skill set, high ethical standards, and attention to detail, coupled with a friendly nature and great sense of humour, Jeremy aligns to industry and vendor best practices, which puts him amongst the leaders of his field. He is intensely passionate about solving technology problems for his organisation, their customers and the tech community, to improve the user experience, reliability and operational support. Views and IP shared on this site belong to Jeremy.
Jeremy Saunders
Jeremy Saunders

Previous post:

Next post: