ETSPA
asked on
REMOVE / DELETE windows 2003 LOG
hello
Im trying to remove the windows system log using command line...
i can backup the system log using "dumpel" but i did not find a way
to remove the log on windows2003.
Any idea ?
thanks
Im trying to remove the windows system log using command line...
i can backup the system log using "dumpel" but i did not find a way
to remove the log on windows2003.
Any idea ?
thanks
Call this vbscript from the command line.
The below example clears the system log on the local machine, defined by 'strLog'. Change as you need to.
HTH
The below example clears the system log on the local machine, defined by 'strLog'. Change as you need to.
HTH
strLog = "System"
strComputer = "."
set objWMI = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
set colLogs = objWMI.ExecQuery("Select * from Win32_NTEventlogFile Where " & _
"Logfilename = '" & strLog & "'")
if colLogs.Count <> 1 then
WScript.Echo "Fatal error. Number of logs found: " & colLogs.Count
WScript.Quit
end if
for each objLog in colLogs
objLog.ClearEventLog
WScript.Echo strLog & " cleared"
next
Save this as a vbs (e.g. clearlog.vbs), then call from the command line via:
cscript clearlog.vbs
Tony.
cscript clearlog.vbs
Tony.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
This will work, its old sysinternals stuff.