What is the point of this line?
$rc=RedirectOutput('@WKSTA.log',0)

To end redirection, it should be as I showed you.
Also, why do you put the ? at the beginning of the line. It should be at the end like I showed you.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.