This really is one of the most valuable scripts I’ve ever written — not because of it’s complexity (it’s not complex) or because it’s incredibly smooth and transparent to the user (it’s neither). It’s valuable because it’s a very simple work around for a problem I’m confident Microsoft could fix — but for some reason hasn’t. And this problem has been plaguing us since the inception of Windows 7 and the inability to copy user profiles. Not a big deal if we didn’t have multi-user machines running DeepFreeze (erases all changes when someone logs in)
You may know that Excel Add-ins are added per user, in the registry. Current User, that is. I’ve tried, to no avail, modifying the HKLM keys, adding the Excel Add-ins automatically for all users. After failing too many times, I decided to simply import the HKCU regkey every time a user logs in. It’s a work around, for sure — but it WORKS and solves a problem for countless many.
In it’s simplest form — login to a computer, add the Excel Add-ins using the steps below:
Launch the registry through Start > Run > Regedit. Navigate to:
You will see several options listed as follows:
“OPEN”=”/R “C:\Program Files\Microsoft Office\Office14\Library\Analysis\ANALYS32.XLL”"
“OPEN1″=”/R “C:\Program Files\Microsoft Office\Office14\Library\Analysis\ATPVBAEN.XLAM”"
“OPEN2″=”"C:\Program Files\Microsoft Office\Office14\Library\EUROTOOL.XLAM”"
“OPEN3″=”"C:\Program Files\Microsoft Office\Office14\Library\SOLVER\SOLVER.XLAM”"
“OPEN4″=”"C:\Program Files\Research Insight\Excel\Spri80.xla”"
The goal is to get this set of registry entries to show up for every user. So we’re going to export the keys — and then import them every single time a user logins into any computer that has DeepFreeze on it.
You could simply place this exported registry key on the local hard drive and then make a batch that runs in startup and contains the following:
regedit /s “C:Program FilesMicrosoft Officeexcel.reg”
Done. It will import the new registry key for the person logging in, before they ever have a chance to launch Excel.
For me, one additional complication is that I’m doing this POST deployment of the OS which is already deepfrozen. So I instructed DeepFreeze to run a late night script during maintenance:
Run a batch file that disables User Account Control:
and then run this batch:
copy “\\networkserver\sharename\Custom\OS_Modifications\Excel_Addins\excel.reg” C:\Users\Public\Desktop
copy “\\networkserver\sharename\Custom\OS_Modifications\Excel_Addins\startup_excel_addins.bat” C:\Users\Public\Desktop
copy “C:\Users\Public\Desktop\excel.reg” “C:\Program Files\Microsoft Office” /Y
copy “C:\Users\Public\Desktop\startup_excel_addins.bat” “C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Startup” /Y
del C:\Users\Public\Desktop\startup_excel_addins.bat /Q
del C:\Users\Public\Desktop\excel.reg /Q
This copies the exported registry key from my server to the local computer desktop (Windows 7 won’t let me copy it directly to the root of C or to Program Files sometimes). It also copies over the batch file that will ultimately be in the startup folder.
It then copies each file from the desktop to their end destination. It then deletes the files from the desktop. Now, with “startup_excel_addins.bat” resting in the Startup folder for ALL USERS, every time someone logs in, this batch file runs quickly and quietly to install the Excel Add-ins. Done!