hmm ... in the section you try to update Office's common user info , the section starts with :

code:
 if existkey('$HKCUSM\Office')=0 

as $HKCUSM seems to be not defined anywhere, the if statement always returns 'false' and skips the entire part ...

So as Jens stated correctly you have to say :

code:
 $HKCUSM='HKEY_CURRENT_USER\SOFTWARE\Microsoft'


before the if statement

hte

J.
_________________________