Sys_ClearEventlog
Description
Section titled “Description”Clears the specified event log, and optionally backs it up first.
Syntax
Section titled “Syntax”Sys_ClearEventlog(sType, bCreateBackup) As Boolean
Parameters
Section titled “Parameters”sType (String)
Section titled “sType (String)”Name of the event log: Application, System or Security
bCreateBackup (Boolean)
Section titled “bCreateBackup (Boolean)”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.
Return value
Section titled “Return value”The function returns False if the backup or the clearing fails.
Example
Section titled “Example”If bStatus Then bStatus = Sys_ClearEventlog("Application", False)If bStatus Then bStatus = Sys_ClearEventlog("Security", True)If bStatus Then bStatus = Sys_ClearEventlog("System", False)Related functions
Section titled “Related functions”Sys_WaitForProcess Sys_Sleep Sys_KillProcess Sys_GetProcessOwner Sys_CompareProcessOwner Constants Package Property Variables