Page 1 of 1 1
Topic Options
#13984 - 2001-11-06 09:34 PM Folder size
Anonymous
Unregistered


Hi all,

Newbi here. I've been working on a script to copy my users My Documents folders to the network server for backup. The part I'm having trouble with is I would like to exit if they have too much to copy. I've seen hints about GetFolderSize in the new release however it doesn't seem to be in the beta I downloaded. It doesn't show up as an available function in the docs either. I've seen a script about user defined functions, is there a way to create a function or will I have to send info to a text and pull the line of info out I need?

Thanks.

Top
#13985 - 2001-11-06 10:07 PM Re: Folder size
Bryce Offline
KiX Supporter
*****

Registered: 2000-02-29
Posts: 3166
Loc: Houston TX
you can find the GetFolderSize() UDF here
http://www.scriptlogic.com/Kixtart/FunctionLib/getfoldersize.asp

because of a limitation on win9x systems, a folder over 2gig will show up as 2gig for those systems.

Bryce

Top
#13986 - 2001-11-06 10:24 PM Re: Folder size
Anonymous
Unregistered


Been there, voted for it, tried it and couldn't get to go. My fault though... Fixed it and am on my way. Are UDFs assembled commands or is there more to it?

Thanks

Top
#13987 - 2001-11-07 05:45 AM Re: Folder size
MCA Offline
KiX Supporter
*****

Registered: 2000-04-28
Posts: 5152
Loc: Netherlands, EU
Dear,

Function in kixtart2001 are simple a piece of code, which make it
possible to create a much easier to read your main script.
Also UDFs can easily reused.

Possible that Bryce can explain why

code:

? GetFolderSize("c:\")
? GetFolderSize("c:\work")
exit

function GetFolderSize($path)
DIM $fso, $fold
$GetFolderSize = -3
if exist($path) = 1
$FSO = createobject("scripting.filesystemobject")
$fold = $fso.getfolder($path)
$GetFolderSize = $fold.size
exit(0)
else
exit(3)
endif
endfunction



c:\ returns an empty result
and
c:\work returns the actual value.
greetings.
_________________________
email scripting@wanadoo.nl homepage scripting@wanadoo.nl | Links | Summary of Site Site KiXforms FAQ kixtart.org library collection mirror MCA | FAQ & UDF help file UDF kixtart.org library collection mirror MCA | mirror USA | mirror europe UDF scriptlogic library collection UDFs | mirror MCA

Top
#13988 - 2005-10-31 02:51 PM Re: Folder size
ClientMaster Offline
Fresh Scripter

Registered: 2005-01-19
Posts: 46
Loc: Tokyo, Japan
any ideas on how to display in MB?
Top
#13989 - 2005-10-31 02:54 PM Re: Folder size
Chris S. Offline
MM club member
*****

Registered: 2002-03-18
Posts: 2368
Loc: Earth
Yes, do the math on the file size (e.g. convert the bytes to MBytes).

Please do not hijack old threads in the future. Instead, start your own thread. There isn't much value in resurrecting a five year old thread.

Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 326 anonymous users online.
Newest Members
Praveer, Ollero, rayyo, Foxlicht, DonChild
17742 Registered Users

Generated in 0.031 seconds in which 0.012 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org