VBcoders Browse New Submit Contact Sign In

No account? Register free

Forgot password?

GetPathSize

Robert E. Phelps  (2 Submissions)   Files/File Controls/Input/Output   Visual Basic 3.0   Intermediate   Wed 3rd February 2021

Very fast recursive function to calculate the size of a directory (folder). This code is simple and built for speed. This code does NOT use the FileSystemObject because it is NOT installed on all PCs, therefore you cannot write code using it (unless you include the scrrun.dll - Microsoft Scripting Runtime with your application). **Update - I added the search options for System, Hidden, and Read-Only files so the result will truely match the same number of bytes that is displayed in Windows Explorer properties.

Inputs
sPathName - The path to the directory

Returns
The size (number of bytes) as a Double

Rate GetPathSize (9(9 Vote))
GetPathSize.bas

GetPathSize Comments

No comments yet — be the first to post one!

Post a Comment

0/1000 characters