Have you verified that $ClientName contains data after the registry read? (Display to screen)
Display the @SERROR value after the WriteValue - what do you get?

The SetM() command will create a machine (System) for all users.

Glenn
_________________________
Actually I am a Rocket Scientist! \:D