Jump to content

List of files that can safely be deleted after install.


Recommended Posts

Ok, let's make a list of files that can be deleted (during cleanup) after a fresh install of windows, such as *.tmp files *.log files etc. that are left behind by windows setup and are no longer needed after setup has completed (not including "Downloaded Installations" and %temp% dir nor regular cleanup stuff).

Here's what I've got, please contribute:

  • %WinDir%\*.log except WindowsUpdate.log
  • %winDir%\*.bak
  • %Windir%\system32\$winnt$.inf
  • %WinDir%\setuplog.txt
  • %winDir%\system32\wbem\Logs\*.log
  • %winDir%\Debug\*.log
  • %winDir%\security\logs\*.log
  • %WinDir%\ntbtlog.txt
  • %WinDir%\OEWABLog.txt
  • %WinDir%\Debug\UserMode\userenv.log

Edited by BoardBabe
Link to comment
Share on other sites


Here is a VBS script that starts from A SFX file it clean up the UA Driver and Install Folder,

pkus some shortcuts then it runs the cleans out the temp files and runs the Clean Manager,

then it defrags the local drives.

Here is the script for those who wish to modify it more.

Save as SystemCleanDefrag.VBS

ON ERROR RESUME NEXT

Const Hidden = 0,Normal = 1,Min = 2

Const HD = 2

Dim Act, Fso, Garbage, Loc, Ts

Set Act = CreateObject("Wscript.Shell")

Set Fso = CreateObject("Scripting.FileSystemObject")

''''' VARIBLES FOR LOCATION AND THE LOC ARRAY NUMBER FOR THEM

'("%AllUsersProfile%")=Loc(0),("%UserProfile%")=Loc(1),("%SystemDrive%")=Loc(2),("%SystemDrive%\Program Files")=Loc(3),("%Windir%")=Loc(4)

Loc = Array(Act.ExpandEnvironmentStrings("%AllUsersProfile%"),Act.ExpandEnvironmentStrings("%UserProfile%"),_

Act.ExpandEnvironmentStrings("%SystemDrive%"),Act.ExpandEnvironmentStrings("%SystemDrive%\Program Files"),_

Wd = Act.ExpandEnvironmentStrings("%Windir%"))

Garbage = Array((Loc(0) & "\Desktop\ Java Web Start.lnk"),(Loc(0) & "\Desktop\ Nero StartSmart.lnk"),(Loc(0) & "\Desktop\ Mozilla.lnk"),_

(Loc(0) & "\Start Menu\ Set Program Access and Defaults.lnk"),(Loc(0) & "\Start Menu\Windows Catalog.lnk"),(Loc(4) & "\System32\$winnt$.inf"),_

(Loc(2) & "\GmanSilentCUP.VBS"),(Loc(2) & "\Drivers"),(Loc(2) & "\Install"))

For Each DelF In Garbage '''' CLEAN UP THE UA FILES

Fso.DeleteFolder(DelF)

Fso.DeleteFile(DelF)

Next

'''' CLEAN UP THE TEMP DIRECTORY AND RUN CLEAN MANAGER

Set Ts = Fso.CreateTextFile("Clean_Temp.Cmd")

Ts.WriteLine "Echo Off"

Ts.WriteLine "set Clean=""%UserProfile%\Local Settings\Temp"""

Ts.WriteLine "cd %Clean%"

Ts.WriteLine "del /q *.*"

Ts.WriteLine "for /F %%a in ('dir /ad /b') do rd %%a"

Ts.Close

Act.Run("Clean_Temp.Cmd"),Hidden,True

Act.run ("cleanmgr /sagerun:99"),Normal , True

Act.popup "Completed The Clean Up", 3 , "Finished", 0 + 48

Fso.deletefile("Clean_Temp.Cmd")

'''' DEFRAG THE LOCAL HARD DRIVES

Set Drv = Fso.Drives

For Each objDrv in Drv

If objDrv.DriveType = HD Then

Act.Popup "Preparing To Defrag This Drive = " & objDrv.DriveLetter & "\" &_

vbCrLf & "Drive Volume Name = " & objDrv.VolumeName, 5, "Defrag Drive", 0 + 32

Act.Run("Defrag.exe " & objDrv & "\ -F"),Min,True

End if

Next

''''CLEAN UP THE VBS FILE WHEN COMPLETED

If Fso.FileExists("SystemCleanDefrag.vbs") Then Fso.DeleteFile("SystemCleanDefrag.vbs") End If

SystemCleanDefrag.exe

Edited by gunsmokingman
Link to comment
Share on other sites

Batch mode ...

del /f /q /s %SystemRoot%\*.log
del /f /q /s %SystemRoot%\*.bak
del /f /q /s %SystemRoot%\system32\$winnt$.inf
del /f /q /s %SystemRoot%\setuplog.txt
del /f /q /s %SystemRoot%\system32\wbem\Logs\*.log
del /f /q /s %SystemRoot%\Debug\*.log
del /f /q /s %SystemRoot%\security\logs\*.log
del /f /q /s %SystemRoot%\ntbtlog.txt
del /f /q /s %SystemRoot%\OEWABLog.txt
del /f /q /s %SystemRoot%\Debug\UserMode\userenv.log

Edited by sonic
Link to comment
Share on other sites

Hehe ok, let's just terminate this topic. no one seems to understand what the topic is all about. I KNOW FINE HOW TO DELETE THE FILES! I'm just creating a list of left over files that you can ADD to your own cleanup if you please.

For me I have understandood you !! This for other guys :thumbup

Otherwise thanks again !

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...