Forum Discussion

pyatakov's avatar
pyatakov
Occasional Contributor
7 years ago

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.html

 

 

Guys?!?

 

 

1 Reply

  • Marsha_R's avatar
    Marsha_R
    Champion Level 3

    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