mega128 Posted December 19, 2005 Share Posted December 19, 2005 I am using this to get folder size: $size = DirGetSize("C:\TestFolder") Msgbox(0,"","Size(MegaBytes):" & Round($size / 1024 / 1024)) How can I get name and size of each sub-folder in TestFolder? Also, can I list all subfolder name and size in a text file? Thanks for reading Link to comment Share on other sites More sharing options...
randallc Posted December 19, 2005 Share Posted December 19, 2005 Hi, If you look at the link from my signature, "recursive", there are many script example links you could modify. The one already with size is "French.au3" I think, but others could be modified Best, Randall ExcelCOM... AccessCom.. Word2... FileListToArrayNew...SearchMiner... Regexps...SQL...Explorer...Array2D.. _GUIListView...array problem...APITailRW Link to comment Share on other sites More sharing options...
Valuater Posted December 19, 2005 Share Posted December 19, 2005 maybe like this #Include <GUIConstants.au3 #include <File.au3> $loc = "C:\temp\" GUICreate("MY GUI") $edit = GUICtrlCreateEdit("", 25, 20, 350, 350) GUISetState() $list = _FileListToArray($loc, "*.*", 2) for $x = 1 to $list[0] GUICtrlSetData( $edit, ($list[$x]) & @CRLF, 1 ) GUICtrlSetData( $edit, (DirGetSize($loc & $list[$x])) & @CRLF, 1) GUICtrlSetData( $edit, " " & @CRLF, 1) Next While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE Exit EndSelect WEnd 8) Link to comment Share on other sites More sharing options...
MrSpacely Posted December 19, 2005 Share Posted December 19, 2005 all sizes of files folders _rundos("dir " & @scriptdir & "\*.* /s /o /a > output.txt") Link to comment Share on other sites More sharing options...
Valuater Posted December 19, 2005 Share Posted December 19, 2005 all sizes of files folders_rundos("dir " & @scriptdir & "\*.* /s /o /a > output.txt")be sure to include#include <Process.au3>*******************************i got an empty file?????and yes ... there are sub-folders8) Link to comment Share on other sites More sharing options...
seandisanti Posted December 20, 2005 Share Posted December 20, 2005 Hi,If you look at the link from my signature, "recursive", there are many script example links you could modify.The one already with size is "French.au3" I think, but others could be modifiedBest, Randallthe one with my name on his 'recursive request' is setup to list all files and folder sizes to a textfile. currently it doesn't use dirgetsize() to get folder size (so i think it returns 0 for folders) but if you plug that one line in, it should do exactly what you want. Link to comment Share on other sites More sharing options...
Zach Posted December 21, 2005 Share Posted December 21, 2005 (edited) all sizes of files folders_rundos("dir " & @scriptdir & "\*.* /s /o /a > output.txt")Thanks - nice to see that someone still is smart enough to not reinvent the wheel Edited December 21, 2005 by Zach Link to comment Share on other sites More sharing options...
mega128 Posted December 28, 2005 Author Share Posted December 28, 2005 Thanks all of you Gurus out there. Special thanks to Valuater. Following is the code that I wrote, which may be bit sloppy, but does the job for me. Thanks again! #Include <GUIConstants.au3 #include <File.au3> $loc = InputBox("Folder Size Path", "Enter the folder path", "", "") Run("notepad.exe") WinWaitActive("Untitled - Notepad") Send("**********************************************************************" & @CRLF) Send("FOLDER SIZE: "&$loc & @CRLF) Send("MAKE SURE NOTEPAD WINDOW IS ACTIVE WHILE APPLICATION IS RUNNING!!!!!!" & @CRLF) Send("*********************************************************************" & @CRLF) Send(@CRLF) Send(@CRLF) $list = _FileListToArray($loc, "*.*", 2) for $x = 1 to $list[0] Send($list[$x] & @TAB) $temp=DirGetSize($loc & $list[$x])/1024/1024 Send(Round($temp)) Send(" MB") Send(@CRLF) Next Send("************************************" & @CRLF) Send("Done"& @CRLF) Send("************************************"& @CRLF) Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now