Thread: C:\ Full
View Single Post
  #4  
Old July 6th 18, 10:09 PM posted to alt.windows7.general
Mayayana
external usenet poster
 
Posts: 6,438
Default C:\ Full

"freface" wrote| Win 7 Pro. All updates.
|
| C:\ is full.
| Deleted obvious stuff but only got 200MB freed.
| Googled and got confused.
|

As Big Al said, it doesn't tell us much if you don't say
how big it is.
One option is to reinstall to get Winsxs back to 4-ish GB.
Then make a disk image so you'll be able to do that more
easily in the future.

Following is a script I use. Paste it into Notepad, save
as Folder Sizes.vbs, then run it. In the prompt type
C:\. It will produce a file in the root of C drive showing
folder sizes, starting with the biggest.
That will help if there's something big that you don't
know about. Backed up email, browser cache, and stored
program files can all take up a lot of space if you don't
clean them up.

'---------- begin script -----------
'-- Note: Watch out for wordwrap. This script is
'-- written to avoid long lines, so it should be OK.

Dim FSO, s1, s2, TS, sDriv, APath(), ASize(), iCnt, iTotal, i2

s1 = "Enter path of folder to list sizes of all subfolders."
s1 = s1 & " For a drive enter X:\, where X is the drive letter."
sDriv = InputBox(s1, "List Folder Sizes")

If Len(sDriv) 3 Then WScript.quit

Set FSO = CreateObject("Scripting.FileSystemObject")

On Error Resume Next

iTotal = 500
ReDim APath(iTotal)
ReDim ASize(iTotal)
iCnt = 0

GetFolderSizes(sDriv)

iCnt = iCnt - 1
ReDim Preserve ASize(iCnt)
ReDim Preserve APath(iCnt)

QuickSort ASize, APath, 0, 0

For i2 = iCnt to 0 step -1
s2 = s2 & APath(i2) & " -- " & CStr(ASize(i2)) & " MB" & vbCrLf
Next

s1 = "Sizes of folders in " & sDriv & vbCrLf
s1 = s1 & "(Note: Sizes are in MB. A size of 0 indicates the"
s1 = s1 & " size is between 0 and 1 MB.)" & vbCrLf & vbCrLf & s2


Set TS = FSO.CreateTextFile("C:\Folder Sizes" & left(sDriv, 1) & ".txt",
True)
TS.Write s2
TS.Close
Set TS = Nothing

MsgBox "List for " & sDriv & " is saved to C:\Folder Sizes.txt", 64

Sub GetFolderSizes(sPath)
Dim oFol, oFols, oFol1, iSz, sList, s
On Error Resume Next

APath(iCnt) = sPath
Set oFol = FSO.GetFolder(sPath)
iSz = oFol.Size
If iSz 1024 Then iSz = iSz / 1024: Else iSz = 0
If iSz 1024 Then iSz = iSz / 1024: Else iSz = 0
iSz = CInt(iSz)
ASize(iCnt) = iSz

iCnt = iCnt + 1
If iCnt + 10 iTotal Then
iTotal = iTotal + 200
ReDim Preserve APath(iTotal)
ReDim Preserve ASize(iTotal)
End If

Set oFols = oFol.SubFolders
If oFols.count 0 Then
For Each oFol1 in oFols
GetFolderSizes(oFol1.Path)
Next
End If
Set oFols = Nothing
Set oFol = Nothing
End Sub

Sub QuickSort(AIn1, AIn2, LBeg, LEnd)
Dim LBeg2, vMid, LEnd2, vSwap1, vSwap2
On Error Resume Next
If (LEnd = 0) Then LEnd = UBound(AIn1)
LBeg2 = LBeg
LEnd2 = LEnd
vMid = AIn1((LBeg + LEnd) \ 2)
Do
Do While AIn1(LBeg2) vMid And LBeg2 LEnd
LBeg2 = LBeg2 + 1
Loop
Do While vMid AIn1(LEnd2) And LEnd2 LBeg
LEnd2 = LEnd2 - 1
Loop
If LBeg2 = LEnd2 Then
vSwap1 = AIn1(LBeg2)
vSwap2 = AIn2(LBeg2)

AIn1(LBeg2) = AIn1(LEnd2)
AIn2(LBeg2) = AIn2(LEnd2)

AIn1(LEnd2) = vSwap1
AIn2(LEnd2) = vSwap2

LBeg2 = LBeg2 + 1
LEnd2 = LEnd2 - 1
End If
Loop Until LBeg2 LEnd2
If LBeg LEnd2 Then QuickSort AIn1, AIn2, LBeg, LEnd2
If LBeg2 LEnd Then QuickSort AIn1, AIn2, LBeg2, LEnd
End Sub


'--------end script ---------------


Ads