Search code examples
c#.netevent-log

Enable Windows Event Log by Managed Code (.NET) / Command Line


Is there a programmatic way which allows me to enable an EventLog if it was disabled by default? In short, I just need to know if I can enable a specific EventLog so that I can use the events programmatically.

Thanks


Solution

  • To Enable the Windows Event Log use the wevtutil

    In particular to enable the Word pad log do the following:

    wevtutil sl "Microsoft-Windows-Wordpad/Admin" /e:true