Jump to content

Cleanup question, delete *.log from %WinDir% safe?


Recommended Posts

Seems theres a bunch of *.log files left after installation in %WinDir%, could all of these files be safely deleted at cleanup.cmd (I run cleanup after WPI), or is anyone needed or used later?

Here's a list of .log files from %WinDir% right after install.

0.log
chipset.log
cmsetacl.log
COM+.log
comsetup.log
DtcInstall.log
FaxSetup.log
GEARInstall.log
iis6.log
imsins.log
KB834707.log
KB867282.log
KB873333.log
KB873339.log
KB883939.log
KB885250.log
KB885835.log
KB885836.log
KB886185.log
KB887742.log
KB887797.log
KB888113.log
KB888302.log
KB888656.log
KB890046.log
KB890047.log
KB890175.log
KB890859.log
KB890923.log
KB891122.log
KB891781.log
KB893066.log
KB893086.log
KB893756.log
KB893803v2.log
KB894391.log
KB896358.log
KB896422.log
KB896423.log
KB896424.log
KB896428.log
KB896688.log
KB896727.log
KB898461.log
KB899587.log
KB899588.log
KB899589.log
KB899591.log
KB900725.log
KB900930.log
KB901017.log
KB901214.log
KB902344.log
KB902400.log
KB903235.log
KB904706.log
KB905414.log
KB905749.log
KB906569.log
MedCtrOC.log
msgsocm.log
msmqinst.log
netfxocm.log
ntdtcsetup.log
ocgen.log
ocmsn.log
oobeact.log
regopt.log
sessmgr.setup.log
setupact.log
setupapi.log
setuperr.log
SetupWLD.log
Sti_Trace.log
SynInst.log
tabletoc.log
tsoc.log
wiadebug.log
wiaservc.log
WindowsUpdate.log
wmsetup.log

Link to comment
Share on other sites


Try this VBS File it will delete only the log files that are not protected.

Those should be safe to delete.

Dim Act, Fso, SD

Set Fso = CreateObject("Scripting.FileSystemObject")

Set Act = CreateObject("Wscript.Shell")

SD = Act.ExpandEnvironmentStrings("%SystemDrive%")

On Error Resume Next

Fso.DeleteFile(SD & "\Windows\*.Log")

Link to comment
Share on other sites

By protected you mean write protected?

I was thinking more like

for /f "usebackq tokens=*" %%i in (`dir /b "%winDir%\*.log"`) do if %%i neq WindowsUpdate.log del /q "%WinDir%\%%i"

Keeping the windows update log to see what's installed on MU/WU web, am I right? This would do the same as above vbs script I guess?

Link to comment
Share on other sites

This is what I mean by protected file, the VBS file will not error or stop.

The only reason why you got the message is that you tried to delete .tmp files, some of which were currently being used by Window, thus undeletable. Within a vbs or a .cmd, you don't have to care about success or failure in such deletions... remaining .tmp will be removed by the system itself anyway.

Natan

http://www.windowsdream.com

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...