So I was working on a clients server today (Windows Server 2003 SBS) that was very low on diskspace on the C:\ .. 634MB actually..
Was sorting through all the folders to figure out where the space was.. To my supprise 4GB of disk usage was in C:\Documents and Settings\[USERNAME]\Local Settings\Temporary Internet Files\Content.IE5 which as anyone who works with computers knows is where friking IE caches websites and downloads. So the quick fix for this is to delete the contents of the folder.. but this is kinda a pain to manualy go into these folders and clear them out for 15 users and even harder if you do it the long way and login each one a click "Delete files" in IE for each account..
So I found this nice little script online someone made and though I would share it.. Credits to whoever wrote it.. Save the code in notepad as cleanup.vbs and then run it.
[Code]
On Error Resume Next
Const HKEY_LOCAL_MACHINE = &H80000002
strComputer = "."
Set objRegistry=GetObject("winmgmts:\\" & _
strComputer & "\root\default:StdRegProv")
Set objFSO = CreateObject("Scripting.FileSystemObject")
strKeyPath = "SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList"
objRegistry.EnumKey HKEY_LOCAL_MACHINE, strKeyPath, arrSubkeys
For Each objSubkey In arrSubkeys
strValueName = "ProfileImagePath"
strSubPath = strKeyPath & "\" & objSubkey
objRegistry.GetExpandedStringValue HKEY_LOCAL_MACHINE, strSubPath, strValueName, strValue
Dim Fol:Fol = strValue & "\Local Settings\Temporary Internet Files\Content.IE5"
If objFSO.FolderExists(Fol) Then
Set f = objFSO.GetFolder(Fol)
Set fc = f.SubFolders
For Each f1 in fc
f1.delete
Next
End If
Next
[/Code]
1 Comment »
RSS feed for comments on this post. TrackBack URI








Wow thanks a lot! I got 1.2gb of space from this
Comment by Levi — April 9, 2009 @ 9:15 am