Uslmis,

You are getting the 0 because REDIRECTOUTPUT, OPEN and CLOSE are all functions which return a result code. If you don't want to see the 0, all you need to do is set use a variable to collect the result code.

Example:
$x = RedirectOutput("logon.log")

OR

$x = Open(1,"test.reg",5)
$x = Close(1)