Copy / Move Maintaining Tree structure
Posted: 09 Nov 2021 02:12
How to copy a folder to target maintaining specified path tree (with the tree folders to be copied empty even if they contain files)
Example:
A dir command creates a text.log with an entry: "C:\user\desktop\FolderA\1\2"
It is asked to Copy / Move
C:\user\desktop\FolderA\1\2
to
C:\user\desktop\FolderB
NOT AS
C:\user\desktop\FolderB\2
BUT AS
C:\user\desktop\FolderB\1\2
C:\user\desktop\FolderA\1 might contain other subfolders (except "2") and / or files.
The C:\user\desktop\FolderB\1 should only contain the subfolder "2", not other folders or files.
Example:
A dir command creates a text.log with an entry: "C:\user\desktop\FolderA\1\2"
It is asked to Copy / Move
C:\user\desktop\FolderA\1\2
to
C:\user\desktop\FolderB
NOT AS
C:\user\desktop\FolderB\2
BUT AS
C:\user\desktop\FolderB\1\2
C:\user\desktop\FolderA\1 might contain other subfolders (except "2") and / or files.
The C:\user\desktop\FolderB\1 should only contain the subfolder "2", not other folders or files.