You are tasked with copying all files from one directory to another while ensuring that the directory structure is maintained, and hidden as well as system files are included in the copy process. Which of the following xcopy commands should you use?
The xcopy command with the /E /H switches is the best choice because /E copies directories and subdirectories, including empty ones, and /H copies hidden and system files as well. While /S also copies directories and subdirectories, it does not include empty directories. The /K switch simply copies attributes, which is not strictly required by the question, and /G allows for copying of encrypted files to a destination that does not support encryption, which is also not required.
Ask Bash
Bash is our AI bot, trained to help you pass your exam. AI Generated Content may display inaccurate information, always double-check anything important.
What do the /E and /H switches in the xcopy command do?
Open an interactive chat with Bash
Why is the /S switch not suitable for this command?
Open an interactive chat with Bash
What are the differences between xcopy and other copy commands, like copy or robocopy?