How to use VBscript to delete custom event log?

Answered How to use VBscript to delete custom event log?

  • Saturday, February 09, 2013 2:29 PM
     
     
    I have used your script to create a custom Event Log but cant find something to delete it? I have an XP system, without PowerShell, and would appreciate any assistance. I have tried Googling this but nothing relevant appears.

All Replies

  • Saturday, February 09, 2013 5:21 PM
     
     
    I have used your script to create a custom Event Log but cant find something to delete it? I have an XP system, without PowerShell, and would appreciate any assistance. I have tried Googling this but nothing relevant appears.
    This is by design: Event logs are here to stay until overwritten by more recent events or cleared altogether.
  • Saturday, February 09, 2013 6:15 PM
     
     Answered

    Custom EventLogs can be deleted by moving the entry from the registry.  The file can be deleted after restarting the eventlog service.

    Be very careful to not delete entries fro the standard event logs or you my crash your system.


    ¯\_(ツ)_/¯

    • Marked As Answer by Trader_Horn Saturday, February 09, 2013 10:49 PM
    •  
  • Saturday, February 09, 2013 6:36 PM
     
     

    You can alos use PowerShell to remove custom event logs:

    [System.Diagnostics.EventLog]::Delete("MyCustomLog")


    ¯\_(ツ)_/¯

  • Saturday, February 09, 2013 6:41 PM
     
     

    Read the following very carefull:

    http://msdn.microsoft.com/en-us/library/twdecbsx(v=vs.80).aspx?cs-save-lang=1&cs-lang=csharp#code-snippet-3

    Remember - "There are no user serviceable parts inside."  "Opening the cover may void the warranty."

    Be careful!


    ¯\_(ツ)_/¯

  • Saturday, February 09, 2013 10:45 PM
     
     
    OK Thanks. I will give this a try then in the absence of a script.
  • Sunday, February 10, 2013 12:24 AM
     
     
    OK Thanks. I will give this a try then in the absence of a script.

    Using the registry method will not work correctly if you have defined custom event providers.  YOu must first delete the providers.  The PowerShell (dotNet) method also removes the providers.


    ¯\_(ツ)_/¯