Ony copy files and sub-folder in a folder to another
SOLVED- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Ony copy files and sub-folder in a folder to another
Hi all,
I have the folders and files as structure
|Folder A
| | Folder A1
| | | FileA1A.txt
| | | FileA1B.txt
| | FileA.txt
| | FileB.pdf
and I only want to copy all files and folders under the folderA to Folder B as structure below
|Folder B
| | Folder A1
| | | FileA1A.txt
| | | FileA1B.txt
| | FileA.txt
| | FileB.pdf
If I use these code
var FolInfo = aqFileSystem.GetFolderInfo(FolderAPath);
// Copies the folder to another location
FolInfo.Copy(FolderB, false);
It will copy all files and folders include FolderA into FolderB as below. But I don't the copy the root folder name (Folder A)
FolderB
|Folder A
| | Folder A1
| | | FileA1A.txt
| | | FileA1B.txt
| | FileA.txt
| | FileB.pdf
Thanks,
Vinh
Solved! Go to Solution.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Are you testing Windows? Why do you need so many subfolders?
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Consider WshShell.Run() and xcopy command (https://stackoverflow.com/questions/7170683/copy-all-files-and-folders-from-one-drive-to-another-dri...)
/Alex [Community Champion]
____
[Community Champions] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Champions]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Champion] signature is assigned on quarterly basis and is used with permission by SmartBear Software.
https://community.smartbear.com/t5/Community-Champions/About-the-Community-Champions-Program/gpm-p/252662
================================
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you, Community!
@tuanvinh1008 did you try the suggested approach?
Sonya Mihaljova
Community and Education Specialist
