Jump to content

filegetsize


Recommended Posts

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 by forever0donotknowme
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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 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.
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

#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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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 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.

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...