Skip to main content

Delete-File

Command Description

Specify a file path and delete the corresponding file

Command Prototype

File.DeleteFile(sPath)

Parameter Description

ParameterRequiredTypeDefaultDescription
sPathTruepath'''C:\Users'''The path of the file that needs to be deleted, 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 needs to be escaped, such as "C:\Laiye RPA" or @res"Laiye RPA\ \Laiye RPA"

Demo

/************************************Delete Files*********** **************************** 
Command prototype:
File.DeleteFile('''C:\Users''')
Input parameters:
sPath--the path of the file to be deleted
Outgoing parameters:
None
********************************************************************************/
Dim sPath='''C:\Users\Chance\Desktop\testFile\data.txt'''
File.DeleteFile(sPath)