You can do one of the two:

IF DELKEY ("HKEY_CURRENT_USER\NETWORK\PERSISTENT\Z")=0
""
ENDIF
...This way you will ask kixtart to write on the screen , but you actually ask him to write nothing.

Your second option is to use REDIRECTOUTPUT
command .
the syntex is :
REDIRECTOUTPUT ("filename",0 or 1)
0=append
1=overwrite
but don't forget to redirectoutput again to the monitor after the end of the error code checking.