Finds the total size of the specified drive(s).
DiskSize(drive-list [, format])
(s) drive-list: one or more drive letters or "UNC Shares" in the format"\\UNC\sharename", separated by"|", or the current file delimiter (usually a tab).
(i) format: controls the format in which the size is returned. See below.
(i) or (f) the total size of a selected disk.
This function takes a string consisting of drive letters or "UNC Shares". When specifying drive letters, only the first character of each non-blank group of characters is used to determine the drives, so you can use just the drive letters, or add a colon (:), or add a backslash (\), and still get a perfectly valid result. When specifying, UNC shares you must specify the root of the UNC share in the format "\\UNC\sharename".
By default, results larger than 2 gigabytes will be returned as a floating point number. However, it should be noted that in Windows 95 prior to OSR 2 incorrect values may be returned for volumes larger than 2 gigabytes.
Format
This is an optional parameter that controls the format in which the size is returned. If the result is too large to be returned as an integer (larger than 2 gigabytes).
Format |
Meaning |
0 |
(Default) Floating Point |
1 |
Huge number. This is a long decimal number string, which may represent a number too large to be converted to an integer.'Huge number' is a special data type. It is a long decimal number string, which may represent a number too large to be converted to an integer. This value can be modified with standard arithmetic operations |
2 |
64-bit Integer. This number representation is fully compatible with arithmetic and relational operators but some functions may error when the number is used as a function parameter if the number is greater than the maximum 32-bit integer . |
size = DiskSize("c", 0) Message("Size of C:", size)