# File_GetSize

> Reads a file's size into giValue, or -1 if the file does not exist.

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

### Description

Get size of file

### Syntax

File_GetSize(sFile) As Boolean

### Parameters

#### sFile (String)

Filename

#### 

### Return value

Result will be stored in giValue. If file does not exist giValue will be equal to -1

### Example

**VBScript**

```vb
If bStatus Then bStatus = File_GetSize("C:\CapaInstaller.txt")
If bStatus Then bStatus = Job_Writelog("Custom", "giValue: " & giValue, bStatus, True) 
```

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

### Related functions

[File_CreateEmptyFile](/capainstaller/vb-scripting-library/file-functions/file-createemptyfile/) [Constants](/capainstaller/vb-scripting-library/addendum/constants/) [Package Property](/capainstaller/vb-scripting-library/addendum/package-property/) [Variables](/capainstaller/vb-scripting-library/addendum/variables/)
