Which command would you use to copy files while preserving their attributes and to ensure that the destination has all the specified files from the source, including any that are not present yet?
robocopy C:\Source D:\Destination /E /COPY:DAT - This is correct. The robocopy command is designed for advanced file copying, and the /E switch ensures all subdirectories are included, even empty ones. The /COPY:DAT switch ensures the file attributes (data, attributes, and timestamps) are preserved. It ensures the destination matches the source, including any new files not already present.
xcopy C:\Source D:\Destination /E /I - While xcopy can copy files and subdirectories (/E), it does not preserve attributes as comprehensively as robocopy and lacks robust options for ensuring complete synchronization between source and destination.
copy C:\Source D:\Destination /V - The copy command is a basic tool for copying files. The /V switch verifies the copied files but does not preserve file attributes or handle subdirectories effectively, making it unsuitable for maintaining attributes or syncing a source and destination.
robocopy C:\Source D:\Destination /S /MOVE - The /S switch copies subdirectories but excludes empty ones, which may not meet the requirement to ensure all files and directories are preserved. Additionally, the /MOVE switch moves files rather than copying them, which might not be the intended behavior.
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 are the main features of the robocopy command?
Open an interactive chat with Bash
What do the switches /E and /COPY:DAT do in the context of robocopy?
Open an interactive chat with Bash
When would you choose robocopy over xcopy or the copy command?