AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

(Hidden) Folder Size

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
larl473032004



Joined: 04 Jul 2004
Posts: 14

PostPosted: Fri Dec 07, 2007 9:41 pm    Post subject: (Hidden) Folder Size Reply with quote

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
View user's profile Send private message
FGR
Guest





PostPosted: Fri Dec 07, 2007 11:39 pm    Post subject: Reply with quote

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

PostPosted: Fri Dec 07, 2007 11:56 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group