Skip to main content

Get-File-Size

Command Description

Specify a file path and get the size in bytes of the file corresponding to the path

Command Prototype

iRet = File.FileSize(sPath)

Parameter Description

ParameterRequiredTypeDefaultDescription
sPathTruepath'''C:\Users'''File path

return

iRet,The variable used to save the output of the command.

Demo

/********************************Get file size************** ********************* 
Command prototype:
iRet = File.FileSize('''C:\Users''')
Input parameters:
sPath--file path
Outgoing parameters:
iRet--The result after the command is run
********************************************************************************/
Dim sPath='''C:\Users\Chance\Desktop\testFile\data.txt'''
iRet = File.FileSize(sPath)
TracePrint(iRet)