I don't see why you couldn't do this but you would probably have to force a re-boot to activate it. Also if the key is embedded in the current machine or user hive you might have to apply it by envoking your script through the runonce key.
_________________________
Jack