How can i export my event logs to a folder (csv or txt) on every start up automatically?

ShaadShaad picture ShaadShaad · Sep 9, 2014 · Viewed 27.6k times · Source

I was looking for either a batch file, powerscript (not really good with yet)or any way to have my event logs exported to txt or csv on every start up? Im using windows 7 pro if that helps

Answer

npocmaka picture npocmaka · Sep 9, 2014

This will output last 20 system event logs in eventlog.txt.Not sure what exactly you need from eventlog - it's a big place...

WEVTUtil query-events System /count:20 /rd:true /format:text > eventlog.txt

You can change System to Application,Security or Setup - not sure what exactly you need.

more info: http://ss64.com/nt/wevtutil.html

check also this: http://ss64.com/nt/psloglist.html

You can save this (or similar) command to bat file and schedule it on start-up