Skip to main content

Copy-Folder

Command Description

Specify a folder path and copy all the contents of the folder to the specified path

Command Prototype

File.CopyFolder(sPathSrc,sPathDst,bOverWrite)

Parameter Description

ParameterRequiredTypeDefaultDescription
sPathSrcTruepath'''C:\Users'''Copied folder path can be absolute path. And can also use @res "path" form to represent path under current process res folder. Path separator needs to be escaped, like: "C:\Laiye RPA" or @res"Laiye RPA\Laiye RPA"
sPathDstTruepath'''C:\Users'''Copy the folder path, you can use the @RES "path" form to indicate the path under the Current ProcessRes folder, if there is no existence, automatically create the folder path separator needs to escape, such as "C: \Laiye RPA"or @res" Laiye RPA\Laiye RPA"
bOverWriteTruebooleanNoneCan select whether to replace a folder of the same name during the copying process. Default is No

Demo

/************************************Copy folder*********** ************************ 
Command prototype:
File.CopyFolder('''C:\Users''','''C:\Users''',false)
Input parameters:
sPathSrc--the copied folder path
sPathDst--the folder path to copy to
bOverWrite--When copying encounters a folder with the same name, you can choose whether to replace it, the default is no
Outgoing parameters:
None
********************************************************************************/
Dim sPathSrc='''C:\Users\Chance\Desktop\testFile'''
Dim sPathDst='''C:\Users\Chance\Desktop'''
File.CopyFolder(sPathSrc,sPathDst,false)