Skip to main content

Check-Folder-Exist

Command Description

Specify a folder path, judge whether the folder corresponding to the path exists, and return a Boolean value. True indicates that it exists, and false indicates that it does not exist

Command Prototype

bRet = File.FolderExists(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 if the folder exists ************ ******************** 
Command prototype:
bRet = File.FolderExists('''C:\Users''')
Input parameters:
sPath--the folder path to be judged
Outgoing parameters:
bRet--The result after the command is run
********************************************************************************/
Dim sPath='''C:\Users\Chance\Desktop\testFile'''
bRet = File.FolderExists(sPath)
TracePrint(bRet)