Microsoft – Windows – C:\Windows\Logs\cbs\cbs.log

Solution

Preparing to install a new application and noticed that I did not have enough room.

And, so what to do  ….

  • Quickly looked for the biggest files
  • The biggest file happens to C:\Windows\Logs\cbs\cbs.log
  • Who owns this file….again, not sure … but need to find out quickly
  • As it is has the .log extension, knew that I can look at its content
  • Type c:\windows\logs\cbs\cbs.log | more
  • cbs.log reads “Starting Trusted Installer”

Who needs Trusted Installer?  You ‘re out of here!

Sample Code

del c:\windows\logs\cbs\cbs.log /Q

 

Delete files automatically – CAB files and CBS log issues
Link


@echo off
for /f %%A in ('dir c:\windows\temp\cab_*^| find "File(s)"') do set cnt=%%A
echo File count = %cnt%
if %cnt% gtr 100 goto :bigger
goto :end

:bigger
rem "Cleaning up some stuff"
del c:\windows\temp\cab_*
rem "Delete old *.tmp files"
forfiles /P "c:\windows\temp" /S /M *.tmp /C "cmd /c del /F /Q @path" /D -30
rem Delete oldest log file in c:\windows\logs\cbs
setlocal
set Folder=c:\windows\Logs\CBS
set FileMask=*.log
set OldestFile=
for /f "delims=" %%a in ('dir /b /o:d "%Folder%\%FileMask%" 2^>NUL') do (
	set OldestFile=%%a
	goto Break
)

:Break
if "%OldestFile%"=="" (
	echo No files found in '%Folder%' matching '%FileMask%'!
) else (
	del "%Folder%\%OldestFile%"
)

:end
__EOF

 

References

  1. Red Branch | For Future Reference
    • Windows 2008 Disk Space and CBS.log
      Link
  2. Spiceworks.com
    • CBS log and CBS persist in %Windir%\logs\CBS
      Link
  3. ServerFault.com
    • Managing CBS.log files on Windows 2008R2?
      Link
  4. Bigfix.com
    • Delete files automatically – CAB files and CBS log issues
      Link

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s