forever0donotknowme Posted May 14, 2012 Posted May 14, 2012 (edited) i had script #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Form1", 399, 225, 192, 124) $Button1 = GUICtrlCreateButton("temp folder", 72, 88, 107, 25) $Button2 = GUICtrlCreateButton("prefetch folder", 232, 88, 91, 25) $Button3 = GUICtrlCreateButton("temp and prefetch", 144, 128, 123, 25) $Label1 = GUICtrlCreateLabel("press following buttons to know size ", 80, 24, 216, 33) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button1 $temp = FileGetSize(@TempDir & "") $temp= $temp / 1024 MsgBox(0, "size .. ", " temp folder size is = " & $temp & " KiloByte") Case $Button2 $prefetch =FileGetSize(@WindowsDir &"prefetch") MsgBox(0, "size .. ", " prefetch folder size is = " & $prefetch & " KiloByte") case $Button3 $all = $prefetch + $temp $all = $all / 1024 msgbox(0,"size","folder size is= "& $all &"kilobyte") EndSwitch WEnd but i can not get size for any folder????!!!! Edited May 14, 2012 by forever0donotknowme
somdcomputerguy Posted May 14, 2012 Posted May 14, 2012 (edited) FileGetSizeRemarksDoes not work on directories.So, try - DirGetSize. Edited May 14, 2012 by somdcomputerguy - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change.
PhoenixXL Posted May 14, 2012 Posted May 14, 2012 Thats the Easy Way Give by SomdComputerGuy But for More Complexity....................... U can get the FileSize of Each n Every File inside the Folder by Ur Script and then Sum up To get The DirSize..... Regards Phoenix XL My code: PredictText: Predict Text of an Edit Control Like Scite. Remote Gmail: Execute your Scripts through Gmail. StringRegExp:Share and learn RegExp.Run As System: A command line wrapper around PSEXEC.exe to execute your apps scripts as System (LSA). Database: An easier approach for _SQ_LITE beginners. MathsEx: A UDF for Fractions and LCM, GCF/HCF. FloatingText: An UDF for make your text floating. Clipboard Extendor: A clipboard monitoring tool. Custom ScrollBar: Scroll Bar made with GDI+, user can use bitmaps instead. RestrictEdit_SRE: Restrict text in an Edit Control through a Regular Expression.
jdelaney Posted May 14, 2012 Posted May 14, 2012 (edited) I've noticed, that doing recursive loops, and pulling each file's size, leads to an over-calculated total usage...not sure why, didn't dig in too deep. Dir... commands return what is expected. Edited May 14, 2012 by jdelaney IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window.
PhoenixXL Posted May 14, 2012 Posted May 14, 2012 I U R rite Recursive Functions WHen GO overhead causes the Autoit To Crash................... Anyways ..........Congratulaitions You Got What U Wanted Regards Phoenix XL My code: PredictText: Predict Text of an Edit Control Like Scite. Remote Gmail: Execute your Scripts through Gmail. StringRegExp:Share and learn RegExp.Run As System: A command line wrapper around PSEXEC.exe to execute your apps scripts as System (LSA). Database: An easier approach for _SQ_LITE beginners. MathsEx: A UDF for Fractions and LCM, GCF/HCF. FloatingText: An UDF for make your text floating. Clipboard Extendor: A clipboard monitoring tool. Custom ScrollBar: Scroll Bar made with GDI+, user can use bitmaps instead. RestrictEdit_SRE: Restrict text in an Edit Control through a Regular Expression.
forever0donotknowme Posted May 15, 2012 Author Posted May 15, 2012 #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Form1", 399, 225, 192, 124) $Button1 = GUICtrlCreateButton("temp folder", 72, 88, 107, 25) $Button2 = GUICtrlCreateButton("prefetch folder", 232, 88, 91, 25) $Button3 = GUICtrlCreateButton("temp and prefetch", 144, 128, 123, 25) $Label1 = GUICtrlCreateLabel("press following buttons to know size ", 80, 24, 216, 33) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button1 $temp = dirGetSize(@TempDir&"") $temp= $temp / 1024 /1024 MsgBox(0, "size .. ", " temp folder size is = " & $temp & " KiloByte") Case $Button2 $prefetch =dirGetSize(@WindowsDir &"prefetch") $prefetch=$prefetch/ 1024 /1024 MsgBox(0, "size .. ", " prefetch folder size is = " & $prefetch & " KiloByte") EndSwitch WEnd but i want the size show without number of fractional
PhoenixXL Posted May 15, 2012 Posted May 15, 2012 Im Not Gettin What U have Asked are U asking to get a Integer................. Then Try Round() or Floor() Or Do U want the Number To Convert Into A Fraction.............?? My code: PredictText: Predict Text of an Edit Control Like Scite. Remote Gmail: Execute your Scripts through Gmail. StringRegExp:Share and learn RegExp.Run As System: A command line wrapper around PSEXEC.exe to execute your apps scripts as System (LSA). Database: An easier approach for _SQ_LITE beginners. MathsEx: A UDF for Fractions and LCM, GCF/HCF. FloatingText: An UDF for make your text floating. Clipboard Extendor: A clipboard monitoring tool. Custom ScrollBar: Scroll Bar made with GDI+, user can use bitmaps instead. RestrictEdit_SRE: Restrict text in an Edit Control through a Regular Expression.
PhoenixXL Posted May 15, 2012 Posted May 15, 2012 (edited) Yeah Sure!! #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Form1", 399, 225, 192, 124) $Button1 = GUICtrlCreateButton("temp folder", 72, 88, 107, 25) $Button2 = GUICtrlCreateButton("prefetch folder", 232, 88, 91, 25) $Button3 = GUICtrlCreateButton("temp and prefetch", 144, 128, 123, 25) $Label1 = GUICtrlCreateLabel("press following buttons to know size ", 80, 24, 216, 33) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button1 $temp = dirGetSize(@TempDir&"") $temp= $temp / 1024 /1024 MsgBox(0, "size .. ", " temp folder size is = " & Round($temp) & " KiloByte");You can Even Try Int in Place of Round Case $Button2 $prefetch =dirGetSize(@WindowsDir &"prefetch") $prefetch=$prefetch/ 1024 /1024 MsgBox(0, "size .. ", " prefetch folder size is = " & Round($prefetch) & " KiloByte");You can Even Try Int in Place of Round Case $Button3 $temp = dirGetSize(@TempDir&"") $temp= $temp / 1024 /1024 $prefetch =dirGetSize(@WindowsDir &"prefetch") $prefetch=$prefetch/ 1024 /1024 MsgBox(0, "size .. ", " prefetch folder size is = " & Round($prefetch+$temp) & " KiloByte") ;You can Even Try Int in Place of Round EndSwitch WEnd Edited May 15, 2012 by PhoenixXL My code: PredictText: Predict Text of an Edit Control Like Scite. Remote Gmail: Execute your Scripts through Gmail. StringRegExp:Share and learn RegExp.Run As System: A command line wrapper around PSEXEC.exe to execute your apps scripts as System (LSA). Database: An easier approach for _SQ_LITE beginners. MathsEx: A UDF for Fractions and LCM, GCF/HCF. FloatingText: An UDF for make your text floating. Clipboard Extendor: A clipboard monitoring tool. Custom ScrollBar: Scroll Bar made with GDI+, user can use bitmaps instead. RestrictEdit_SRE: Restrict text in an Edit Control through a Regular Expression.
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