Without actually testing any of that code, I wonder also about the order that the hotfixes are applied. Often there are prerequisites, and as Jens mentioned, some do require reboots.

It was an assumption on my part that this was to be in a logon script as there is no mention of it being an admin script.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.