Also, sice he failed to wrap it in quotes, I think KiX might try to do math on:
SETFILEATTR (h:\ts-menu, 2)

Missing quotes here too:
$robocmd= %logonserver%\netlogon\tools\robocopy.exe
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.