 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
larl473032004
Joined: 04 Jul 2004 Posts: 14
|
Posted: Fri Dec 07, 2007 9:41 pm Post subject: (Hidden) Folder Size |
|
|
I need to get a list of all of the $NTUninstall Sub-Folders in in the the Windows folder along with the total disk space they take up.
Using the following code:
| Code: |
Search = %A_Windir%\$NTUninstall*.*
FileList =
Loop, %Search% ,2,1
FileList = %FileList%%A_LoopFilelongPath%`t%A_LoopFileSizekB%`n
Sort, FileList, R
Loop, parse, FileList, `n
{
if A_LoopField =
continue
StringSplit, FileItem, A_LoopField, %A_Tab%
outputlist .= "The File: " FileItem1 "`tSize is: " FileItem2 "kB. `n"
}
MsgBox, 8192, $NTUninstall*** Files, %outputlist%`n
|
I do get th list of folders, however the Size always shows 0 . . . . What am I doing something wrong - - What have I missed?
[/code] |
|
| Back to top |
|
 |
FGR Guest
|
Posted: Fri Dec 07, 2007 11:39 pm Post subject: |
|
|
| You should retrieve the size of each file inside the hidden folders |
|
| Back to top |
|
 |
engunneer
Joined: 30 Aug 2005 Posts: 6847 Location: Pacific Northwest, US
|
Posted: Fri Dec 07, 2007 11:56 pm Post subject: |
|
|
| Quote: |
| Code: |
; Example #2: Calculate the size of a folder, including the files in all its subfolders:
SetBatchLines, -1 ; Make the operation run at maximum speed.
FolderSizeKB = 0
FileSelectFolder, WhichFolder ; Ask the user to pick a folder.
Loop, %WhichFolder%\*.*, , 1
FolderSizeKB += %A_LoopFileSizeKB%
MsgBox Size of %WhichFolder% is %FolderSizeKB% KB.
|
|
_________________
Unless otherwise noted, all code is untested.
Common Answers: 1.(Loops, Viruses, etc.) 2. Search 3.RTFM |
|
| Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|