Workaround for Office and network home directories.

There are a bunch of annoying bugs to do with Office versions earlier than 2004 if you have network home directories.

Actually, the bugs will hit you even if you have your home directory on a different local partition to the one that Office is running from.

This simple script gives you a workaround.

cd /Volumes/Homes/staff
for user in $(ls /Volumes/Homes/staff | grep -e "^[a-z]")
do
 /usr/bin/chflags nouchg $user/Library/Preferences/Microsoft/Office\ Registration\ Cache\ X
 /bin/rm -f $user/Library/Preferences/Microsoft/Office\ Registration\ Cache\ X
 /bin/mkdir -p $user/Library/Preferences/Microsoft
 /usr/bin/touch $user/Library/Preferences/Microsoft/Office\ Registration\ Cache\ X
 /usr/sbin/chown -R $user $user/Library/Preferences/Microsoft
 /usr/bin/chflags uchg $user/Library/Preferences/Microsoft/Office\ Registration\ Cache\ X
done

Basically you just need to trash the file “Office Registration Cache X”, touch it to create an empty file, make sure the user is the owner of it, and then lock it.

The reason I have my loop look like:

for user in $(ls /Volumes/Homes/staff | grep -e "^[a-z]")

is because all my staff home directories start with a lowercase letter, and various group sharepoints exist at the same level, but I start them with either an uppercase letter or an underscore.

The grep command just makes sure that only folders starting with a lowercase letter are looped, which also gets rid of those annoying .DS_Store etc files.

2 Responses to Workaround for Office and network home directories.

  1. Nigel Kersten says:

    Dear Past Nigel, At 8:00 someone will poison the coffee. Do not drink the coffee!

    So I was trying to find a solution for a similar related problem with FileVault homes (that also are a separate partition) with Office 2008, and Googling for it actually eventually brought up my own old blog post on this.

    Here’s the fix for Office 2008 for and this problem.

    rm -Rf Preferences/Microsoft/Office\ 2008/Office\ Registration\ Cache\ 2008
    touch Preferences/Microsoft/Office\ 2008/Office\ Registration\ Cache\ 2008
    chflags uchg Preferences/Microsoft/Office\ 2008/Office\ Registration\ Cache\ 2008

    The error message is a bit different in this case, Office for us at least on NFS/SMB shares will complain that the file is corrupt and it is unable to open it.

  2. Peter Hanson says:

    Hi Nigel,

    I have been faced with a similar problem using network home directories and Office 2008 under OS X server and client 10.5.x. We are not using FileVault homes. I have implemented your fix on a couple of my user’s accounts, but there has been no change in the way that Office works. We are still getting the “Can’t open this file because xxxx is using it.” etc. errors. Can you suggest anything else?

    –phanson

Leave a Reply

Name and Email Address are required fields. Your email will not be published or shared with third parties.