FolderRisk: Caution
Logs C:\Windows\Logs
Folder of Windows servicing text logs (CBS, DISM, Windows Update, MoSetup), not to be mistaken for the .evtx event logs.
What it’s for
C:\Windows\Logs gathers the text logs of the components that install, update and repair Windows. This is where you look to find out why an update, an sfc run or a DISM run failed. Do not confuse it with the event logs (.evtx files in System32\winevt\Logs), which you read with Event Viewer.
What it contains
CBS: Component-Based Servicing log, includingCBS.log(servicing operations andsfcresults).DISM: log of the DISM tool (dism.log).WindowsUpdate: Windows Update agent traces.MoSetup(Modern Setup of upgrades) andDPX(extraction of update packages).NetSetupandSIHalso appear depending on the version and components.
Risks and best practices
- Keep these logs during an incident:
CBS.loganddism.logare the first files support asks for after a failed update or repair. - To reclaim space, first copy the old large files if an analysis is in progress, then delete them. Keep the folder itself: Windows recreates it, but the history is gone.
- The logs cite machine names, user names and paths, so scrub them before sharing.
Useful commands
# Size of each subfolderGet-ChildItem "$env:windir\Logs" -Directory -Force | ForEach-Object { $b = (Get-ChildItem $_.FullName -Recurse -Force -File -ErrorAction SilentlyContinue | Measure-Object Length -Sum).Sum [pscustomobject]@{ Folder = $_.Name; 'Size (MB)' = [math]::Round($b / 1MB, 1) }}
# The 10 most recently modified filesGet-ChildItem "$env:windir\Logs" -Recurse -File -Force -ErrorAction SilentlyContinue | Sort-Object LastWriteTime -Descending | Select-Object -First 10 FullName, LastWriteTimeFolder contents
Folders 6
- CBSComponent-Based Servicing (CBS) logs: update and feature installation, sfc /scannow…
- DISMFolder for the DISM tool logs (dism.log), which trace Windows image servicing operations…
- DPXLogs of the DPX component (delta package expansion) used during updates and upgrades…
- MeasuredBootC:\Windows\Logs\MeasuredBoot: binary TCG logs of Measured Boot (measurements recorded in…
- MoSetupLogs of Modern Setup for Windows 10 and 11 upgrades, including BlueBox.log and…
- WindowsUpdateFolder of Windows Update .etl trace files, to convert with Get-WindowsUpdateLog into a…