When we need to copy files and folders in Windows while need to maintain its file system attributes, there is a handy utility which is included in Windows (especially the rather outdated Windows) which is called xcopy. The command is as simple as:
xcopy [sourcefolder] [destinationfolder] /X /H /E /V /Y
The explanation for the parameters is:
/X – Copies file audit settings and file ownership and ACL information.
/H – Copies hidden and system files.
/E – Copies directories and subdirectories, including empty ones.
/V – Verifies each new file.
/Y – Suppresses prompting to confirm you want to overwrite an existing destination file.