Skip to main content


Command Description

Specify a file path and get the file extension of the file corresponding to the path

Command Prototype

sNameExtension = File.ExtensionName(sPath)

Parameter Description

sPathTruepath'''C:\Users'''The path of the file, you can fill in the absolute path or use the @res "path" form 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 "


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


/********************************Get file extension ************* ********************* 
Command prototype:
sNameExtension = File.ExtensionName('''C:\Users''')
Input parameters:
sPath--path to file
Outgoing parameters:
sNameExtension--the result of running the command
Dim sPath='''C:\Users\Chance\Desktop\testFile\data.txt'''
sNameExtension = File.ExtensionName(sPath)