WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

Event Logs

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

Clear Event Log

Keywords: 	  clear event log

Script to clearing event log:

dllname=strcat(dirwindows(1),"Advapi32.dll")
Open_Func="OpenEventLogA"
Clear_Func="ClearEventLogA"
server=""
logfile="Application"
backupfile=0
hlog=dllcall(dllname,long:Open_Func,lpstr:server,lpstr:logfile)
if hlog
   rc=dllcall(dllname,long:Clear_Func,long:hlog,long:backupfile)
   if rc==0
      Message("Error","Either %logfile% is empty or Backup File already exists")
      exit
   end if
end if
Message("Success","%logfile% has been cleared")
exit


Article ID:   W14966
File Created: 2001:11:08:12:41:10
Last Updated: 2001:11:08:12:41:10