FolderRisk: Caution
winevt C:\Windows\System32\winevt
C:\Windows\System32\winevt: container folder of the Windows Event Log service. The .evtx logs are in the Logs subfolder.
What it’s for
winevt is the anchor point of the Windows Event Log service (EventLog). It is mostly a container: the logs themselves are in the Logs subfolder.
What it contains
Logs, which holds the.evtxfiles:System,Security,Application, plus the “Applications and Services Logs” channels.
Risks and best practices
- Files in use are locked by the EventLog service. Moving or deleting the folder by hand makes the service fail.
- To relocate a log, change its path with
wevtutil sl <log> /lfn:<path>(or the log’sFileRegistry value), not with File Explorer. - To clear a log, use Event Viewer or
wevtutil cl, after a backup (wevtutil epl) if the log has audit value.
Useful commands
# The largest logs, with their fileGet-WinEvent -ListLog * -ErrorAction SilentlyContinue | Sort-Object FileSize -Descending | Select-Object -First 10 LogName, FileSize, MaximumSizeInBytes, LogFilePath