[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

REMOVE / DELETE windows 2003 LOG

Posted on 2009-02-23
4
Medium Priority
?
585 Views
Last Modified: 2012-05-06
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
0
Comment
Question by:ETSPA
  • 2
4 Comments
 
LVL 7

Expert Comment

by:droyden
ID: 23709146
http://technet.microsoft.com/en-us/sysinternals/bb897544.aspx

This will work, its old sysinternals stuff.
0
 
LVL 27

Expert Comment

by:bluntTony
ID: 23709160
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
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

Open in new window

0
 
LVL 27

Expert Comment

by:bluntTony
ID: 23709162
Save this as a vbs (e.g. clearlog.vbs), then call from the command line via:

cscript clearlog.vbs

Tony.
0
 
LVL 15

Accepted Solution

by:
tenaj-207 earned 1500 total points
ID: 23709178
There is no command line option like dumpel to delete the event logs, but you can use a script.  Microsoft has a couple of canned ones and there are others as well.

http://www.microsoft.com/technet/scriptcenter/scripts/logs/eventlog/default.mspx?mfr=true

or
http://www.dotnetspider.com/resources/23594-Delete-Event-log-VB-NET.aspx
0

Featured Post

Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Setting up a Microsoft WSUS update system is free relatively speaking if you have hard disk space and processor capacity.   However, WSUS can be a blessing and a curse. For example, there is nothing worse than approving updates and they just have…
While rebooting windows server 2003 server , it's showing "active directory rebuilding indices please wait" at startup. It took a little while for this process to complete and once we logged on not all the services were started so another reboot is …
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
Whether it be Exchange Server Crash Issues, Dirty Shutdown Errors or Failed to mount error, Stellar Phoenix Mailbox Exchange Recovery has always got your back. With the help of its easy to understand user interface and 3 simple steps recovery proced…

872 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question