I have this command "robocopy C:\ G:\Backup\ /E /XD “C:\Windows” /MT:8". The File…
- User
I have this command "robocopy C:\ G:\Backup\ /E /XD “C:\Windows” /MT:8". The File shouldnt be mark as system files
- Assistant
You can add the
/A-:SHflag to the robocopy command to ensure that the files are not marked as system files. The modified command would look like this:coderobocopy C:\ G:\Backup\ /E /XD “C:\Windows” /MT:8 /A-:SHThis flag tells robocopy to copy the files without marking them as system files.
- User
Can i define a list with excluded folders
- Assistant
Yes, you can define a list of folders to be excluded from the robocopy command. Instead of using the
/XDflag multiple times, you can create a text file with a list of folders to exclude and then reference that file in the robocopy command using the/XFflag.Here's how you can do it:
- Create a text file (e.g., excluded_folders.txt) in the same directory as your robocopy command file.
- List the folders you want to exclude, each on a separate line, in the text file. For example:
codeC:\Windows C:\Program Files- Modify your robocopy command to include the
/XFflag and reference the text file with the excluded folders list. Your command would now look like this:
coderobocopy C:\ G:\Backup\ /E /XF excluded_folders.txt /MT:8 /A-:SHThis way, you can easily manage and update the list of excluded folders by editing the text file without having to modify the robocopy command itself.