The usage of the VBS property AvailableSpace
This article mainly introduces "the usage of VBS attribute AvailableSpace". In daily operation, I believe many people have doubts about the usage of VBS attribute AvailableSpace. The editor consulted all kinds of materials and sorted out simple and easy-to-use operation methods. I hope it will be helpful for you to answer the doubts about "the usage of VBS attribute AvailableSpace"! Next, please follow the editor to study!
Returns the amount of free space for the specified drive or network share for the user.
Object.AvailableSpace
Object should be the name of the Drive object.
Description
The value returned by the AvailableSpace property is basically the same as that returned by the FreeSpace property. For computer systems that support quotas, the values returned by these two properties are different.
The following code illustrates how to use the AvailableSpace property:
Function ShowAvailableSpace (drvPath) Dim fso, d, s Set fso = CreateObject ("Scripting.FileSystemObject") Set d = fso.GetDrive (fso.GetDriveName (drvPath)) s = "Drive" & UCase (drvPath) & "-" s = s & d.VolumeName & "
"s = s &" available space: & FormatNumber (d.AvailableSpace/1024, 0) s = s & "Kbytes" ShowAvailableSpace = sEnd Function this ends the study of "the use of the VBS attribute AvailableSpace", hoping to solve everyone's doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!