Give me robocopy command to copy file and do not save its attributes - rewrite them
- User
Give me robocopy command to copy file and do not save its attributes - rewrite them
- Assistant
To use
robocopyto copy files and ensure that the destination files do not retain the original attributes, you can use a combination of options that effectively achieve this goal. One way to do it is by excluding the attributes during the copy and then using an additional command to set the desired attributes afterward.Here's a basic example of how you might structure the
robocopycommand: - User
one command to copy file without saving its attributes short answer only command
- Assistant
Certainly! To copy files without retaining their original attributes in one command, use:
robocopy source_directory destination_directory /copy:DT - User
this preserve file date created attrs
- Assistant
I apologize for any confusion earlier. To ensure that the file attributes, including the creation date, are not preserved,
robocopyitself does not have a direct option. However, you can usexcopywith specific switches to exclude attributes and effectively reset timestamps:xcopy source_directory destination_directory /E /K /Y /F /H /C attrib -A -S -R -H destination_directory\* /S /DHere,
/Eincludes subdirectories,/Kcopies attributes,/Yanswers yes to overwrite questions,/Fshows full source and destination file names while copying,/Hcopies hidden and system files, and/Ccontinues copying even if errors occur.To simplify, if you aim to reset attributes including timestamps, an alternative and often simpler approach is to use a different set of tools or custom scripts post-copy.
robocopyalone cannot perform the operation entirely within one command to strip specific attributes as it focuses heavily on robust data replication rather than selective exclusion of metadata. - User
I need to change attributes of doc file. But when you open doc file with 7zip you can see folder MsoDataStore and it has oroginal attrs. How to modify this attrs too,
- Assistant
The
MsoDataStorefolder inside a.docfile is part of the internal structure of the document when it uses certain Office features such as Office Open XML formats. These elements are part of the actual document's data and are zipped into the file, which makes it a bit more complex to manipulate using basic file system tools.