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
Exporting Event Viewer Logs Click on the Search icon in the Windows tray and type Event Viewer, click once it appears in the Search window. Expand Windows Logs. Click on the System located in the left pane. Save as Systemlogs on Desktop.
By default, Event Viewer log files use the . evt extension and are located in the %SystemRoot%\System32\winevt\Logs folder. Log file name and location information is stored in the registry.
Open "Event Viewer" by clicking the "Start" button. Click "Control Panel" > "System and Security" > "Administrative Tools", and then double-click "Event Viewer" Click to expand "Windows Logs" in the left pane, and then select "Application". Click the "Action" menu and select "Save All Events As".
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
WEVTUtil query-events System /count:20 /rd:true /format:text > exported_file_name.csv /q:"Event[System[(EventID=1074)]]"
Then gpedit.msc - windows settings - scripts and add to start up. Thanks @npockmaka for getting this started
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With