# Sys_GetFreeDiskSpace

> Reads free disk space on a drive into giValue, and sets the package to Not Compliant when less than the required number of megabytes is free.

Source: https://docs.capaone.com/capainstaller/vb-scripting-library/system-functions/sys-getfreediskspace/  
Product: CapaInstaller — a separate CapaSystems product; do not apply this page to any other.

### Description

Gets free disk space

### Syntax

Sys_GetFreeDiskSpace(sDrive, iRequired) As Boolean

### Parameters

#### sDrive (String)

Specified disk-drive

#### iRequired (Integer)

Number of required MegaBytes

### Return value

Result will be stored in giValue.   
If free disk space is less than iRequired the function will set package status to 'Not Compliant'

### Example

**VBScript**

```vb
If bStatus Then bStatus = Sys_GetFreeDiskSpace ("C:\", 10)
If bStatus Then bStatus = Job_Writelog("Custom", "giValue: " & giValue, bStatus, True)
```

[Scripting Guidelines](/capainstaller/vb-scripting-library/scripting-guidelines/)

### Related functions

[Sys_GetFileSystemType](/capainstaller/vb-scripting-library/system-functions/sys-getfilesystemtype/) [Sys_GetDriveType](/capainstaller/vb-scripting-library/system-functions/sys-getdrivetype/) [Constants](/capainstaller/vb-scripting-library/addendum/constants/) [Package Property](/capainstaller/vb-scripting-library/addendum/package-property/) [Variables](/capainstaller/vb-scripting-library/addendum/variables/)
