Hi All,
I have written a function which writes all the errors generated into an ERROR LOG instead of displaying it on the screen.
Code:
Function LogErrors($ErrorValue, optional $MiscInfo1, optional $MiscInfo2)
If RedirectOutput($ErrorFile) = 0
If $ErrorValue = $ERROR_ACCESS_DENIED
? "Access is Denied for computer $MiscInfo1"
Else If $ErrorValue = $ERROR_BAD_NETPATH
? "The network path was not found for the computer $MiscInfo1"
Else
? "File not opened, error code: [" + $ErrorValue + "]"
If $MiscInfo1 > 0
? $MiscInfo1
EndIf
EndIf
EndIf
EndFunction
BUT the surprising thing that in the error statements, some ZEROS also got appended. (I don't know how
)
here's a partial error log:
The network path was not found for the computer compname129A0
Access is Denied for computer compname129B00
First statement has 1 zero while 2nd statement has 2 zeros.
How are these zeros getting appended. Plz. let me know.
N.B. $ErrorFile is the name of the Error File.
Thank you.