1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Hey Does someone know how to clear log data in my system

Discussion in 'General Chat' started by hima, Mar 2, 2006.

  1. #1
    Hi

    I just wanted to know how to clear all the files that i have accessed in the system Importantly, the log files...

    Does anybody have some idea about it??

    I know how to clear history and all
    and one more thing this is a lan connection.

    Pls let me know.... Any help is greatly appreciated.

    Thanks.
     
    hima, Mar 2, 2006 IP
  2. SumitBahl

    SumitBahl Reign of Chaos

    Messages:
    5,170
    Likes Received:
    596
    Best Answers:
    0
    Trophy Points:
    310
    #2
    Try this tool. I use it and its good.

    What kinda logs are you referring to ?
     
    SumitBahl, Mar 3, 2006 IP
  3. hima

    hima Peon

    Messages:
    297
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Hi
    Thanks for the info
    I am using it
    the log files created when i loginto my website or so........
     
    hima, Mar 3, 2006 IP
  4. SumitBahl

    SumitBahl Reign of Chaos

    Messages:
    5,170
    Likes Received:
    596
    Best Answers:
    0
    Trophy Points:
    310
    #4
    If you are referring to the passwords and drop down items in IE, then to clear these items do the following:

    Open Internet Explorer.
    On the Tools menu, click Internet Options. Then click the Content tab.
    Next, choose the AutoComplete button.
    Check off Clear Forms and/or Clear Passwords to clear all saved items from the AutoComplete history.
    Click OK a couple of times to exit.
     
    SumitBahl, Mar 3, 2006 IP
  5. hima

    hima Peon

    Messages:
    297
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    yeah

    Thanks for explaining in detailed but i know this process

    but i am nt talking abt those things....

    some logs that server admin can have a look of

    In that case, how to erase .........
     
    hima, Mar 3, 2006 IP
  6. SumitBahl

    SumitBahl Reign of Chaos

    Messages:
    5,170
    Likes Received:
    596
    Best Answers:
    0
    Trophy Points:
    310
    #6
    In case you are asking about event logs, here is a little help on clearing them

    Source

    Backing up and clearing an event log

    Listing 12.5 contains a script that backs up and then clears the Application event log on a computer. To carry out this task, the script must perform the following steps:

    1.
    Create a variable to specify the computer name.

    2.
    Use a GetObject call to connect to the WMI namespace root\cimv2, set the impersonation level to "impersonate," and include the Backup privilege.

    To use the BackupEventLog method, you must include the Backup privilege as part of your connection string. Backup is a user right that must be explicitly assigned and included as part of the GetObject moniker.

    3.
    Use the ExecQuery method to query the Win32_NTEventLogFile class.

    To limit data retrieval to the Application event log, include a Where clause specifying Application as the LogFileName. This returns a collection with a single item: the Application event log.

    4.
    For the sole item in the collection, use the WMI BackupEventLog method to back up the event log, specifying the full path to the backup file when using this method. If the backup file does not exist, WMI will create a new backup file.

    However, if a backup file by that name already exists, the backup attempt will fail. The failure occurs because the BackupEventLog method does not allow you to overwrite an existing backup file or to append additional records to an existing backup file. This is another security measure, one that prevents anyone from modifying archived event logs. Without this provision, an unscrupulous administrator could back up and clear the event logs, open the backup files, and then remove any events he or she wanted to keep secret.

    5.
    Use the WMI ClearEventLog method to clear the event log.

    In the script, this method will run only if the backup succeeded; if the BackupEventLog method returns anything other than 0, this means the backup failed. As a result, the message "The application event log could not be backed up" is echoed to the screen, and the event log is not cleared.


    Listing 12.5 Backing Up and Clearing an Event Log

     strComputer = "."
    Set objWMIService = GetObject("winmgmts:" _
     & "{impersonationLevel=impersonate,(Backup)}!\\" & _
     strComputer & "\root\cimv2")
    Set colLogFiles = objWMIService.ExecQuery _
     ("SELECT * FROM Win32_NTEventLogFile WHERE LogFileName='Application'")
    For Each objLogfile in colLogFiles
     errBackupLog = objLogFile.BackupEventLog("c:\scripts\application.evt")
     If errBackupLog <> 0 Then
     Wscript.Echo "The Application event log could not be backed up."
     Else
     objLogFile.ClearEventLog()
     End If
    Next
    Code (markup):
     
    SumitBahl, Mar 3, 2006 IP
  7. hima

    hima Peon

    Messages:
    297
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #7
    Hi

    Thanks for the help

    I think its the thing i am looking for...
     
    hima, Mar 3, 2006 IP