# Sys_CheckEventlogForSystemErrors

> Checks if any critical errors occurs in the Windows Eventlog on local machine and logs errors if any.

Source: https://docs.capaone.com/capainstaller/vb-scripting-library/system-functions/sys-checkeventlogforsystemerrors/  
Product: CapaInstaller — a separate CapaSystems product; do not apply this page to any other.

### Description

Checks if any critical errors occurs in the Windows Eventlog on local machine and logs errors if any.  
The errorstring from the Eventlog will be returned in gsValue.

### **General disable:**

To disable Sys_CheckEventlogForSystemErrors for a client set the following registry key:  
HKLM\Software\CapaSystems\CapaInstaller   
Variable: DisableEventchk   
Value: True  
  
To disable Sys_CheckEventlogForSystemErrors for all client set the following variable in customlib.cis   
  
gbDisableEventChk=True  
  
The statement must be placed in the function IncludeScriptingLibrary before the following line "IncludeScriptingLibrary=bStatus. Afterwards customlib.cis must be deployed to all computers.

### Syntax

Sys_CheckEventlogForSystemErrors() As Boolean

### Example

**VBScript**

```vb
If bStatus Then bStatus = Sys_CheckEventlogforSystemErrors()
```

[Scripting Guidelines](/capainstaller/vb-scripting-library/scripting-guidelines/)

### Related functions

[Job_ErrorHandling](/capainstaller/vb-scripting-library/job-functions/job-errorhandling/) [Constants](/capainstaller/vb-scripting-library/addendum/constants/) [Package Property](/capainstaller/vb-scripting-library/addendum/package-property/) [Variables](/capainstaller/vb-scripting-library/addendum/variables/)
