Reply
Highlighted
Occasional Contributor

aqfilesystem.copyfolder not correctly work

Hi!

 

I have

C:\Folder1\

C:\Folder1\Foder1.1\

C:\Folder1\Foder1.2\

C:\Folder1\File1.1.txt

C:\Folder2\

 

I JUST want copy all content from C:\Folder1\ to C:\Folder2\

I call copy on VB

 

Call aqfilesystem.copyfolder("C:\Folder1", "C:\Folder2")

 

MAIN Question, what result expect 99,9% of normal people?

 

Right, they expect that ALL content of C:\Folder1 will be copy in C:\Folder2, i.e. after call this code

Call aqfilesystem.copyfolder("C:\Folder1", "C:\Folder2")

 

They MUST see this picture 

C:\Folder1\

C:\Folder1\Foder1.1\

C:\Folder1\Foder1.2\

C:\Folder1\File1.1.txt

C:\Folder2\

C:\Folder2\Foder1.1\

C:\Folder2\Foder1.2\

C:\Folder2\File1.1.txt

 

But NOT this cr*p

C:\Folder1\

C:\Folder1\Foder1.1\

C:\Folder1\Foder1.2\

C:\Folder1\File1.1.txt

C:\Folder2\

C:\Folder2\Folder1\Foder1.1\

C:\Folder2\Folder1\Foder1.2\

C:\Folder2\Folder1\File1.1.txt

 

Even according to the documentation I must see normal result

https://support.smartbear.com/testcomplete/docs/reference/program-objects/aqfilesystem/copyfolder.ht...

 

 

Guys?!?

 

 

Community Hero

Re: aqfilesystem.copyfolder not correctly work

Well actually it says it will copy the original folder too, not just the contents

 

Use the CopyFolder method to copy a folder (or a group of folders), including all of its contents, to another location. The method can resolve possible name collisions that may occur while copying folders.

The following statement creates a copy of the C:\MyFolder folder in C:\TempFolder:

 
Call aqFileSystem.CopyFolder("C:\MyFolder", "C:\TempFolder")
 
I think what you want is CopyFile