code:
$RC=RedirectOutput('\\AFNBLFSRV1\INVLOG\@HOSTNAME.CSV') 

will go to the line of code from where on you want to redirect console output to the specified file.
_________________________
There are two types of vessels, submarines and targets.