Skip to main content

Check-File-Exist

Command Description

Specify a file path. Returns a Boolean value for whether the file path exists. True indicates that the file path exists

Command Prototype

bRet = File.FileExists(sPath)

Parameter Description

ParameterRequiredTypeDefaultDescription
sPathTruepath'''C:\Users'''For the folder path to be judged, you can fill in the absolute path or use @ res "path" to represent the path under the res folder of the current process. The path separator needs to be escaped, such as "C:\Laiye RPA" or @res "Laiye RPA\Laiye RPA"

return

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

Demo

/************************************ Determine whether the file exists ************ ******************** 
Command prototype:
bRet = File.FileExists('''C:\Users''')
Input parameters:
sPath--the file path that needs to be judged
Outgoing parameters:
bRet--The result after the command is run
********************************************************************************/
Dim sPath='''C:\Users\Chance\Desktop\testFile\data.txt'''
bRet = File.FileExists(sPath)
TracePrint(bRet)