Skip to content

Sys_ClearEventlog

Clears the specified event log, and optionally backs it up first.

Sys_ClearEventlog(sType, bCreateBackup) As Boolean

Name of the event log: Application, System or Security

True backs up the event log before it’s cleared. The backup is saved as %WinDir%\System32\EventLogBackup\<sType>_<M><D><YYYY>.evt, for example Application_9292026.evt. An existing backup with the same name is replaced.

The function returns False if the backup or the clearing fails.

If bStatus Then bStatus = Sys_ClearEventlog("Application", False)
If bStatus Then bStatus = Sys_ClearEventlog("Security", True)
If bStatus Then bStatus = Sys_ClearEventlog("System", False)

Scripting Guidelines

Sys_WaitForProcess Sys_Sleep Sys_KillProcess Sys_GetProcessOwner Sys_CompareProcessOwner Constants Package Property Variables