Skip to main content

Check-Path-Is-Folder

Command Description

Specify a folder path or a variable. If it is a folder, it will return True. If it is not a folder, it will return False. If it is illegal, it will throw an error and stop

Command Prototype

bIsDirectory = File.IsFolder(sPath)

Parameter Description

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

return

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

Demo

/******************************** Determine if the path is a folder ************ ******************** 
Command prototype:
bIsDirectory = File.IsFolder('''C:\Users''')
Input parameters:
sPath--the path of the folder
Outgoing parameters:
bIsDirectory--the result after the command is run
********************************************************************************/
Dim sPath='''C:\Users\Chance\Desktop\testFile'''
bIsDirectory = File.IsFolder(sPath)
TracePrint(bIsDirectory)