command line remove read only flag on all subfolder entries or overwrite read only files with robocopy

3

I need one of two things to work:

  1. I use robocopy to copy all sub-files and sub-folders from one folder to another, and the destination contains older files + files not in the source, and I need the files from the source to overwrite destination if present. The problem with this approach is read-only files.

    robocopy .... /E /NP /njh /njs /ndl /nc /ns /IA:R /IA:A /A-:R
    
  2. I might use the windows command attrib but that does not remove the read-only flag for sub-files.

    attrib -r <path-to-folder> /S /D
    

    I might use it without the last two arguments as well.

Note: UAC is completely disabled and I am the owner of the files.

I cannot use xcopy as that does not work in bjam for me, and I don't have all the paths for all the files: I only have parent source folder and parent destination folder. The hierarchy must remain.

Warszo.Sertz

Posted 2011-05-25T12:43:31.170

Reputation: 31

Did you try the attrib command line on the source, the destination or even both? – aschipfl – 2017-06-27T12:38:36.970

No answers