Меню

Robocopy ошибка 5 0x00000005 изменение атрибутов файла

RRS feed

  • Remove From My Forums
  • Question

  • Hi All,

       When i run robocopy i got below error. But i can see the pdf in that folder?

    Robocopy \server1HR \server2HR /XF thumbs.db *.tmp /XD DfsrPrivate /E /SEC /MOT:120 /XO /B /FFT /r:2 /w:2  /log+:c:RobocopylogsHR01.LOG /TEE /FP 

        2020/01/07 14:06:11 ERROR 5 (0x00000005) Copying File \server1HR1. Employee Data1. Active1. Head officeHerson, Travis — Letter of Offer — 1 December 2015.pdf Access
    is denied.

    As

    • Edited by
      AUSSUPPORT
      Wednesday, January 8, 2020 3:20 AM

All replies

  • Hi,

    Even though you can see the PDF it may still be permission issues, try taking ownership of the file and give yourself full control permissions, also make sure you run robocopy as administrator.

    Best regards,
    Leon


    Blog:
    https://thesystemcenterblog.com
    LinkedIn:

  • Hi Leon,

      I forgot to tell you i’m copying cross forest with two trust. 

      Robocopy \server1.abc.comHR \server2.xyz.comHR /XF thumbs.db *.tmp /XD DfsrPrivate /E /SEC /MOT:120 /XO /B /FFT /r:2
    /w:2  /log+:c:RobocopylogsHR01.LOG /TEE /FP 

     i’m login to the server1.abc.com and running the above command. So i use below command before run the above.

    net use \server2.xyz.comdata /user:xyzasxx *

    Do i have to add xyz user to the ownership? 

    As

  • HI

     i already followed that steps…

    As

  • First make sure you can even access and view stuff in the other domain, make sure you use the correct credentials.


    Blog:
    https://thesystemcenterblog.com
    LinkedIn:

  • First make sure you can even access and view stuff in the other domain, make sure you use the correct credentials.


    Blog:

    https://thesystemcenterblog.com
    LinkedIn:

    Hi Leon,

        I can see the  target folders by login to the source server .. also its got copy folders and sub folders but no file copy in some folders. i think i have to give full permission to source server for destination user. 

    ex: hr.log

    2020/01/13 22:42:33 ERROR 5 (0x00000005) Copying File \server1.abc.comHR2. Site & Team FoldersAchiveDeeHR8. OtherWork Instructions — Ali & Dee 4.docx
    Access is denied.

    ERROR: RETRY LIMIT EXCEEDED.

      0%  
    100%  
        New File 
       23131 \server1.abc.comHR2. Site & Team FoldersAchiveDeeHR8. OtherX1,TCS, ITIS, TP, X2 Payroll Calendar 2014-2015.xlsx
      0%  
    100%  
        New File 
         162 \server1.abc.com\HR2. Site & Team FoldersAchiveDeeHR8. Other~$ccess Profile — Leader of Self — v1.docx
      0%  
    100%  
        New File 
         162 \server1.abc.com\HR2. Site & Team FoldersAchiveDeeHR8. Other~$e Plakalovic — Annual Performance Review 2014.doc
      0%  
    100%  
        New File 
         162 \server1.abc.com\HR2. Site & Team FoldersAchiveDeeHR8. Other~$R Audit List — 10.10.2014.docx
      0%  
    100%  
      New Dir          5
    \server1.abc.com\HR2. Site & Team FoldersAchiveDeeHR8. OtherATO Casual to FT
        New File 
       51690 \server1.abc.com\HR2. Site & Team FoldersAchiveDeeHR8. OtherATO Casual to FTATO Casual to Perm — Consolidated List of Employees.docx
    2020/01/13 22:42:35 ERROR 5 (0x00000005) Copying File \server1.abc.com\HR2. Site & Team FoldersAchiveDeeHR8. OtherATO Casual to FTATO1 Casual to Perm — Consolidated List of Employees.docx
    Access is denied.

    Waiting 2 seconds… Retrying…
        New File 
       51690 \server1.abc.com\HR2. Site & Team FoldersAchiveDeeHR8. OtherATO Casual to FTATO1 Casual to Perm — Consolidated List of Employees.docx
    2020/01/13 22:42:37 ERROR 5 (0x00000005) Copying File \server1.abc.com\HR2. Site & Team FoldersAchiveDeeHR8. OtherATO Casual to FTATO1 Casual to Perm — Consolidated List of Employees.docx
    Access is denied.

    Waiting 2 seconds… Retrying…

    As

  • So the access denied does not happen on all files/folders, better make sure the credentials you’re using to copy has sufficient permissions both on the source and destination (Full Control preferred).


    Blog:
    https://thesystemcenterblog.com
    LinkedIn:

    • Proposed as answer by
      Danie1zhouMicrosoft contingent staff
      Wednesday, January 15, 2020 8:36 AM

  • Hi Leon,

     Are these open files? i can see these are not copied?

          Reporting~$DAILY INTRA REPORT 1000.xlsx
           ~$2019.12 December Daily Report.xlsx
           7. Documentation~$ath Check Form.docx 

  • The «~$…..» files you mentioned are so-called owner files (sometimes referred to as «lock» files).

    An owner file is created when you work with a document in Word, and it should be deleted when you save your document and exit Word, so yes the documents are open.


    Blog:
    https://thesystemcenterblog.com
    LinkedIn:

RRS feed

  • Remove From My Forums
  • Question

  • Hi All,

       When i run robocopy i got below error. But i can see the pdf in that folder?

    Robocopy \server1HR \server2HR /XF thumbs.db *.tmp /XD DfsrPrivate /E /SEC /MOT:120 /XO /B /FFT /r:2 /w:2  /log+:c:RobocopylogsHR01.LOG /TEE /FP 

        2020/01/07 14:06:11 ERROR 5 (0x00000005) Copying File \server1HR1. Employee Data1. Active1. Head officeHerson, Travis — Letter of Offer — 1 December 2015.pdf Access
    is denied.

    As

    • Edited by
      AUSSUPPORT
      Wednesday, January 8, 2020 3:20 AM

All replies

  • Hi,

    Even though you can see the PDF it may still be permission issues, try taking ownership of the file and give yourself full control permissions, also make sure you run robocopy as administrator.

    Best regards,
    Leon


    Blog:
    https://thesystemcenterblog.com
    LinkedIn:

  • Hi Leon,

      I forgot to tell you i’m copying cross forest with two trust. 

      Robocopy \server1.abc.comHR \server2.xyz.comHR /XF thumbs.db *.tmp /XD DfsrPrivate /E /SEC /MOT:120 /XO /B /FFT /r:2
    /w:2  /log+:c:RobocopylogsHR01.LOG /TEE /FP 

     i’m login to the server1.abc.com and running the above command. So i use below command before run the above.

    net use \server2.xyz.comdata /user:xyzasxx *

    Do i have to add xyz user to the ownership? 

    As

  • HI

     i already followed that steps…

    As

  • First make sure you can even access and view stuff in the other domain, make sure you use the correct credentials.


    Blog:
    https://thesystemcenterblog.com
    LinkedIn:

  • First make sure you can even access and view stuff in the other domain, make sure you use the correct credentials.


    Blog:

    https://thesystemcenterblog.com
    LinkedIn:

    Hi Leon,

        I can see the  target folders by login to the source server .. also its got copy folders and sub folders but no file copy in some folders. i think i have to give full permission to source server for destination user. 

    ex: hr.log

    2020/01/13 22:42:33 ERROR 5 (0x00000005) Copying File \server1.abc.comHR2. Site & Team FoldersAchiveDeeHR8. OtherWork Instructions — Ali & Dee 4.docx
    Access is denied.

    ERROR: RETRY LIMIT EXCEEDED.

      0%  
    100%  
        New File 
       23131 \server1.abc.comHR2. Site & Team FoldersAchiveDeeHR8. OtherX1,TCS, ITIS, TP, X2 Payroll Calendar 2014-2015.xlsx
      0%  
    100%  
        New File 
         162 \server1.abc.com\HR2. Site & Team FoldersAchiveDeeHR8. Other~$ccess Profile — Leader of Self — v1.docx
      0%  
    100%  
        New File 
         162 \server1.abc.com\HR2. Site & Team FoldersAchiveDeeHR8. Other~$e Plakalovic — Annual Performance Review 2014.doc
      0%  
    100%  
        New File 
         162 \server1.abc.com\HR2. Site & Team FoldersAchiveDeeHR8. Other~$R Audit List — 10.10.2014.docx
      0%  
    100%  
      New Dir          5
    \server1.abc.com\HR2. Site & Team FoldersAchiveDeeHR8. OtherATO Casual to FT
        New File 
       51690 \server1.abc.com\HR2. Site & Team FoldersAchiveDeeHR8. OtherATO Casual to FTATO Casual to Perm — Consolidated List of Employees.docx
    2020/01/13 22:42:35 ERROR 5 (0x00000005) Copying File \server1.abc.com\HR2. Site & Team FoldersAchiveDeeHR8. OtherATO Casual to FTATO1 Casual to Perm — Consolidated List of Employees.docx
    Access is denied.

    Waiting 2 seconds… Retrying…
        New File 
       51690 \server1.abc.com\HR2. Site & Team FoldersAchiveDeeHR8. OtherATO Casual to FTATO1 Casual to Perm — Consolidated List of Employees.docx
    2020/01/13 22:42:37 ERROR 5 (0x00000005) Copying File \server1.abc.com\HR2. Site & Team FoldersAchiveDeeHR8. OtherATO Casual to FTATO1 Casual to Perm — Consolidated List of Employees.docx
    Access is denied.

    Waiting 2 seconds… Retrying…

    As

  • So the access denied does not happen on all files/folders, better make sure the credentials you’re using to copy has sufficient permissions both on the source and destination (Full Control preferred).


    Blog:
    https://thesystemcenterblog.com
    LinkedIn:

    • Proposed as answer by
      Danie1zhouMicrosoft contingent staff
      Wednesday, January 15, 2020 8:36 AM

  • Hi Leon,

     Are these open files? i can see these are not copied?

          Reporting~$DAILY INTRA REPORT 1000.xlsx
           ~$2019.12 December Daily Report.xlsx
           7. Documentation~$ath Check Form.docx 

  • The «~$…..» files you mentioned are so-called owner files (sometimes referred to as «lock» files).

    An owner file is created when you work with a document in Word, and it should be deleted when you save your document and exit Word, so yes the documents are open.


    Blog:
    https://thesystemcenterblog.com
    LinkedIn:

Симптомы

Рассмотрим следующий сценарий:

  • Добавить учетную запись пользователя группе операторов архива домена или локальной группы «Операторы архива».

  • Эта учетная запись используется для входа на компьютер под управлением Windows 7 или Windows Server 2008 R2.

  • Используйте команду Robocopy с параметром /B скопировать некоторые файлы, не имеют разрешения на доступ или владельца.

В этом случае эти файлы будут скопированы успешно. Тем не менее их данные конфигурации безопасности, такие как список управления доступом (ACL) не копируется. Вместо этого эти файлы наследуют их ACL из конечной папки.

Кроме того утилиту Robocopy.exe возвращает одно из следующих сообщений об ошибке:


  • Ошибка 5 (0x00000005), копирование безопасности NTFS для конечного каталога < имя каталога > доступ запрещен

  • Ошибка 5 (0x00000005), копирование безопасности NTFS для конечного файла< имя каталога > доступ запрещен

Следует иметь в виду при запуске программы Robocopy.exe с параметром /B для копирования файла является членом группы «Операторы архива», все, что должен быть скопирован. Член должен иметь доступ к сведениям о конфигурации безопасности файла, даже если член не имеет разрешений для файла или владельца файла.

Причина

Эта проблема возникает, так как программа Robocopy.exe не открыть эти файлы с помощью флага «цель резервного копирования», если используется параметр /B . Это предотвращает доступ к сведения о конфигурации безопасности для пользователя, имеющего «Резервного копирования файлов и каталогов» прав (SE_BACKUP_PRIVILEGE).

Примечание. Если файл открыт с помощью флага «цель резервного копирования», проверяются определенные права доступа, и пользователю, открывшему файл предоставляется соответствующий доступ к файлу.

Решение

Сведения об исправлении

Существует исправление от корпорации Майкрософт. Однако данное исправление предназначено для устранения только проблемы, описанной в этой статье. Применяйте это исправление только в тех случаях, когда наблюдается проблема, описанная в данной статье. Это исправление может проходить дополнительное тестирование. Таким образом если вы не подвержены серьезно этой проблеме, рекомендуется дождаться следующего пакета обновления, содержащего это исправление.

Если исправление доступно для скачивания, имеется раздел «Пакет исправлений доступен для скачивания» в верхней части этой статьи базы знаний. Если этот раздел не отображается, обратитесь в службу поддержки для получения исправления.

Примечание. Если наблюдаются другие проблемы или необходимо устранить неполадки, вам может понадобиться создать отдельный запрос на обслуживание. Стандартная оплата за поддержку будет взиматься только за дополнительные вопросы и проблемы, которые не соответствуют требованиям конкретного исправления. Чтобы получить полный список телефонов поддержки и обслуживания клиентов корпорации Майкрософт или создать отдельный запрос на обслуживание, посетите следующий веб-сайт корпорации Майкрософт:

http://support.microsoft.com/contactus/?ws=supportПримечание. В форме «Пакет исправлений доступен для скачивания» отображаются языки, для которых доступно исправление. Если нужный язык не отображается, значит исправление для данного языка отсутствует.

Предварительные условия

Для установки этого исправления на компьютере должна быть установлена Windows Server 2008 R2 или Windows 7.

Необходимость перезагрузки

Необходимо перезагрузить компьютер после установки данного исправления.

Сведения о замене исправлений

Это исправление не заменяет ранее выпущенные исправления.

Сведения о файлах

Английский (США) версия данного исправления устанавливает файлы с атрибутами, указанными в приведенных ниже таблицах. Дата и время для файлов указаны в формате UTC. Дата и время для файлов на локальном компьютере отображаются в местном времени с вашим текущим смещением летнего времени (DST). Кроме того, при выполнении определенных операций с файлами, даты и время могут изменяться.

Примечания к сведениям о файлах Windows 7 и Windows Server 2008 R2

Важно. Исправления для Windows Server 2008 R2 и Windows 7 включены в одни и те же пакеты. Однако исправления на странице запроса исправлений перечислены под обеими операционными системами. Чтобы запросить пакет исправления, который применяется к одной или обеим ОС, установите исправление, описанное в разделе «Windows 7/Windows Server 2008 R2» страницы. Всегда смотрите раздел «Информация в данной статье относится к следующим продуктам» статьи для определения фактических операционных систем, к которым применяется каждое исправление.

  • Файлы MANIFEST (.manifest) и MUM (.mum), устанавливаемые для каждой среды, указаны отдельно в разделе «Сведения о дополнительных файлах для Windows Server 2008 R2 и Windows 7». Файлы MUM и MANIFEST, а также связанные файлы каталога безопасности (CAT) чрезвычайно важны для поддержания состояния обновленных компонентов. Файлы каталога безопасности, для которых не перечислены атрибуты, подписаны цифровой подписью корпорации Майкрософт.

Для всех поддерживаемых 86-разрядных версий Windows 7

Имя файла

Версия файла

Размер файла

Дата

Время

Платформа

Robocopy.exe

5.1.10.1027

98,816

19-Feb-2010

07:55

x86

Для всех поддерживаемых 64-разрядных версий Windows 7 и Windows Server 2008 R2

Имя файла

Версия файла

Размер файла

Дата

Время

Платформа

Robocopy.exe

5.1.10.1027

128,000

19-Feb-2010

08:02

x64

Robocopy.exe

5.1.10.1027

98,816

19-Feb-2010

07:55

x86

Для всех поддерживаемых версий Windows Server 2008 R2 для систем на базе процессоров IA-64

Имя файла

Версия файла

Размер файла

Дата

Время

Платформа

Robocopy.exe

5.1.10.1027

265,216

19-Feb-2010

06:34

IA-64

Robocopy.exe

5.1.10.1027

98,816

19-Feb-2010

07:55

x86

Статус

Корпорация Майкрософт подтверждает, что это проблема продуктов Майкрософт, перечисленных в разделе «Относится к».

Дополнительные сведения

Для получения дополнительных сведений о терминологии обновлений программного обеспечения щелкните следующий номер статьи базы знаний Майкрософт:

Описание 824684 Стандартные термины, используемые при описании обновлений программных продуктов Майкрософт

Для получения дополнительных сведений щелкните следующий номер статьи базы знаний Майкрософт:

973776 сведения о конфигурации безопасности, такие как ACL, не копируются, если оператор архива не использует утилиту Robocopy.exe с параметром /B для копирования файла на компьютере под управлением Windows Vista или Windows Server 2008

Сведения о дополнительных файлах

Сведения о дополнительных файлах для Windows 7 и Windows Server 2008 R2

Дополнительные файлы для всех поддерживаемых версий Windows 7 для систем на базе x86

Имя файла

Update.mum

Версия файла

Неприменимо

Размер файла

1,674

Дата (UTC)

19-Feb-2010

Время (UTC)

10:58

Платформа

Неприменимо

Имя файла

X86_9d98df7ec5fa21d047486476f18692d3_31bf3856ad364e35_6.1.7600.20648_none_9cf47061efb3ad1e.manifest

Версия файла

Неприменимо

Размер файла

696

Дата (UTC)

19-Feb-2010

Время (UTC)

10:58

Платформа

Неприменимо

Имя файла

X86_microsoft-windows-robocopy_31bf3856ad364e35_6.1.7600.20648_none_c79566c966b24883.manifest

Версия файла

Неприменимо

Размер файла

2,586

Дата (UTC)

19-Feb-2010

Время (UTC)

08:24

Платформа

Неприменимо

Дополнительные файлы для всех поддерживаемых версий Windows Server 2008 R2 с архитектурой IA-64

Имя файла

Ia64_558f690380b00de69835c91def69e446_31bf3856ad364e35_6.1.7600.20648_none_6b75fb69a08aba9d.manifest

Версия файла

Неприменимо

Размер файла

698

Дата (UTC)

19-Feb-2010

Время (UTC)

10:58

Платформа

Неприменимо

Имя файла

Ia64_9d98df7ec5fa21d047486476f18692d3_31bf3856ad364e35_6.1.7600.20648_none_9cf61457efb1b61a.manifest

Версия файла

Неприменимо

Размер файла

697

Дата (UTC)

19-Feb-2010

Время (UTC)

10:58

Платформа

Неприменимо

Имя файла

Ia64_microsoft-windows-robocopy_31bf3856ad364e35_6.1.7600.20648_none_c7970abf66b0517f.manifest

Версия файла

Неприменимо

Размер файла

2,588

Дата (UTC)

19-Feb-2010

Время (UTC)

09:25

Платформа

Неприменимо

Имя файла

Update.mum

Версия файла

Неприменимо

Размер файла

1,684

Дата (UTC)

19-Feb-2010

Время (UTC)

10:58

Платформа

Неприменимо

Имя файла

X86_microsoft-windows-robocopy_31bf3856ad364e35_6.1.7600.20648_none_c79566c966b24883.manifest

Версия файла

Неприменимо

Размер файла

2,586

Дата (UTC)

19-Feb-2010

Время (UTC)

08:24

Платформа

Неприменимо

Дополнительные файлы для всех поддерживаемых 64-разрядных версий Windows 7 и Windows Server 2008 R2

Имя файла

Amd64_289a23833955983618528339f2d450e2_31bf3856ad364e35_6.1.7600.20648_none_b09b47b22cf89dfe.manifest

Версия файла

Неприменимо

Размер файла

700

Дата (UTC)

19-Feb-2010

Время (UTC)

10:58

Платформа

Неприменимо

Имя файла

Amd64_9d98df7ec5fa21d047486476f18692d3_31bf3856ad364e35_6.1.7600.20648_none_f9130be5a8111e54.manifest

Версия файла

Неприменимо

Размер файла

698

Дата (UTC)

19-Feb-2010

Время (UTC)

10:58

Платформа

Неприменимо

Имя файла

Amd64_microsoft-windows-robocopy_31bf3856ad364e35_6.1.7600.20648_none_23b4024d1f0fb9b9.manifest

Версия файла

Неприменимо

Размер файла

2,590

Дата (UTC)

19-Feb-2010

Время (UTC)

09:31

Платформа

Неприменимо

Имя файла

Update.mum

Версия файла

Неприменимо

Размер файла

2,328

Дата (UTC)

19-Feb-2010

Время (UTC)

10:58

Платформа

Неприменимо

Имя файла

X86_microsoft-windows-robocopy_31bf3856ad364e35_6.1.7600.20648_none_c79566c966b24883.manifest

Версия файла

Неприменимо

Размер файла

2,586

Дата (UTC)

19-Feb-2010

Время (UTC)

08:24

Платформа

Неприменимо

Нужна дополнительная помощь?

check
Best Answer

  • Author Matt Bell

    OP
    MB13977


    This person is a Verified Professional

    This person is a verified professional.

    Verify your account
    to enable IT peers to see that you are a professional.

    chipotle

    This was down to file permissions in the end. I ended up having to take ownership then give the administrator permissions.

    I created two batch files with the following commands to do this:

    takeown /F <username>AppData /R /D y

    icacls <username>AppData /reset


    Was this post helpful?
    thumb_up
    thumb_down

  • View Best Answer in replies below

    5 Replies

    • Author Thomas Lee

      tfl


      This person is a Verified Professional

      This person is a verified professional.

      Verify your account
      to enable IT peers to see that you are a professional.

      mace

      It may be that the folder in question actually has been set to deny you access. There are a bunch of folders under Windows folder that are not normally accessible.

      What folders?


      Was this post helpful?
      thumb_up
      thumb_down

    • Author Matt Bell

      OP
      MB13977


      This person is a Verified Professional

      This person is a verified professional.

      Verify your account
      to enable IT peers to see that you are a professional.

      chipotle

      Thanks for the reply tfl.

      It looks like it’s profiles, various files in …AppDataRoaming…   <filename>.thmx among others.


      Was this post helpful?
      thumb_up
      thumb_down

    • Author Thomas Lee

      tfl


      This person is a Verified Professional

      This person is a verified professional.

      Verify your account
      to enable IT peers to see that you are a professional.

      mace

      Yes — those are probably locked down too.

      You can try changing the ACLs — but that could be a pretty tedious job.


      Was this post helpful?
      thumb_up
      thumb_down

    • Author Matt Bell

      OP
      MB13977


      This person is a Verified Professional

      This person is a verified professional.

      Verify your account
      to enable IT peers to see that you are a professional.

      chipotle

      I thought using the /B for Backup mode would still copy them.

      I found this post, about 8 posts down from N. Naik, about a script to fix it. What do you think?

       https://social.technet.microsoft.com/Forums/office/en-US/fcac089c-f2e5-4b2d-9e4f-ec637f8ead52/roboco… Opens a new window


      Was this post helpful?
      thumb_up
      thumb_down

    • Author Matt Bell

      OP
      MB13977


      This person is a Verified Professional

      This person is a verified professional.

      Verify your account
      to enable IT peers to see that you are a professional.

      chipotle

      This was down to file permissions in the end. I ended up having to take ownership then give the administrator permissions.

      I created two batch files with the following commands to do this:

      takeown /F <username>AppData /R /D y

      icacls <username>AppData /reset


      Was this post helpful?
      thumb_up
      thumb_down

    • Remove From My Forums
    • Question

    • Hi everyone.  I’ve read a lot of posts about Error 5 but all the recommendations haven’t worked.  When I run the initial robocopy it works fine, however when I run the same script again the next time, it fails with Error 5 access denied.  I
      did notice that the use I am using shows permissions in the parent folder as Special Permissions to This Folder Only.  Anyone have any ideas?  I’m using version 6.1.7601 that was downloaded from this site: http://support.microsoft.com/kb/2639043
      and the command line: robocopy SOURCE TARGET /MIR /copy:DATSO /B /FFT /R:1 /W:1 /LOG:c:robocopylog1.txt 

    Answers

      • Marked as answer by

        Tuesday, May 12, 2015 3:26 AM

    I am getting the above error while I am using robocopy command. I have given all possible permissions on both source and destination folders but still I am getting this error. Any idea how to fix this.

    asked Jul 18, 2011 at 11:58

    sam's user avatar

    Is this to and from ntfs partitions?

    If you are coping to FAT of EXT then add the /FFT parameter to assume FAT file times (2 second granularity) ext2/ext3 also uses 2 second granularity.

    You could also try using the /COPY:DT parameter, by default robocopy copies the data, attributes and timestamp /COPY:DT will skip the attributes.

    Also check your share permissions as well as your ntfs permissions

    answered Jul 18, 2011 at 12:06

    Phil Eddies's user avatar

    2

    For me it worked fine when I ran the command directly on the server, but when I ran it from PowerShell remoting I would get this error. I was also trying to copy files from the local machine to a network share. The fix for me was to use:

    Invoke-Command -ComputerName $sourceServer -Credential $credential -Authentication Credssp -ScriptBlock {
        & RoboCopy "C:Source" "\OtherServerC$Destination" /E
    }
    

    Specifically, using -Credential $credential -Authentication Credssp fixed the issue for me.

    You didn’t provide enough info to know if this is the same issue you were having, but thought I’d mention it for others who encounter the same error message.

    answered Jan 4, 2021 at 23:51

    deadlydog's user avatar

    deadlydogdeadlydog

    21.8k14 gold badges105 silver badges117 bronze badges

    I am getting the above error while I am using robocopy command. I have given all possible permissions on both source and destination folders but still I am getting this error. Any idea how to fix this.

    asked Jul 18, 2011 at 11:58

    sam's user avatar

    Is this to and from ntfs partitions?

    If you are coping to FAT of EXT then add the /FFT parameter to assume FAT file times (2 second granularity) ext2/ext3 also uses 2 second granularity.

    You could also try using the /COPY:DT parameter, by default robocopy copies the data, attributes and timestamp /COPY:DT will skip the attributes.

    Also check your share permissions as well as your ntfs permissions

    answered Jul 18, 2011 at 12:06

    Phil Eddies's user avatar

    2

    For me it worked fine when I ran the command directly on the server, but when I ran it from PowerShell remoting I would get this error. I was also trying to copy files from the local machine to a network share. The fix for me was to use:

    Invoke-Command -ComputerName $sourceServer -Credential $credential -Authentication Credssp -ScriptBlock {
        & RoboCopy "C:Source" "\OtherServerC$Destination" /E
    }
    

    Specifically, using -Credential $credential -Authentication Credssp fixed the issue for me.

    You didn’t provide enough info to know if this is the same issue you were having, but thought I’d mention it for others who encounter the same error message.

    answered Jan 4, 2021 at 23:51

    deadlydog's user avatar

    deadlydogdeadlydog

    21.8k14 gold badges105 silver badges117 bronze badges

    Infopackets Reader Gerry J. writes:

    » Dear Dennis,

    Thanks for your article on how to reset admin password on a Seagate NAS (network attached storage) — this was the only article I could find on the subject. I have a related question. I’ve done a full reset of the NAS (wiping out all data) and recreated my network shares, and now I’m ready to copy data back. In the past, I’ve used Windows file copy to do this, but sometimes it fails and then I have to start over again. I did research on this subject and it’s my understanding robocopy is a much more reliable method and will actually resume the transfer if interrupted. The problem is that every time I try to copy the data back to the NAS, I keep getting an error ‘ERROR 5 (0x00000005) Changing File Attributes’. I can’t seem to find the answer to this and require your expertise. Can you please help? «

    My response:

    I asked Gerry if he would like me to connect to his machine using
    my remote desktop support service in order to have a closer look, and he agreed.

    Below I will discuss my findings.

    How to Fix: NAS, Robocopy ERROR 5 (0x00000005) Changing File Attributes

    After some research, it appears that when robocopy copies files, it will (by
    default) attempt to store file attributes in addition to the data and time
    stamps on the destination media.

    Since a NAS is essentially a mini Linux machine (box) with hard drives attached to it, attempting to modify file attributes will result in an error because Linux is in control of the storage and only permits limited changes to files — even while copying a file.

    Therefore, the way to get around this problem is to not to copy the file attributes using robocopy’s command line arguments.

    For example, the following command would work:

    robocopy e:temp s: /e /copy:DT /w:1 /r:1 /v /log:»c:temprobocopy_copy_back_to_nas.txt»

    This assumes the e:temp is the source directory and s: is the destination (NAS). The
    /copy:DT switch tells robocopy to copy the data and time stamps (but
    not
    the file attributes), while /w:1 and r:/1 says to only retry a maximum of 1 times if there is an error in the file copy, with 1 second intervals between retries. The /log:»c:temprobocopy_copy_back_to_nas.txt» line means to make a log of the file copy and save it to c:temprobocopy_copy_back_to_nas.txt, while the /v switch means to log verbose errors such as skipped files or files with errors.

    How to View Robocopy Log Output (Powershell)

    If you want to view the log while it’s copying, open up a powershell command prompt and run the following script:

    Get-Content c:temprobocopy_copy_back_to_nas.txt -tail 1 -wait

    This will provide you with a window of activity (with 1 second intervals) to
    see the progress. In Gerry’s case it took over a week to copy the data back onto
    the NAS, so this was incredibly useful — plus he can parse the log file for
    errors if needed, described next.

    How to View Robocopy Log for Errors

    To scan the above log file for the word «error», you could use the following
    syntax via the command line (with limitations):

    type c:temprobocopy_copy_back_to_nas.txt |findstr -i error >c:temprobocopy_error_log.txt

    This will output any error messages to c:temprobocopy_error_log.txt —
    however you may need to open the log to find the exact reason for the error.
    Frankly speaking that might be irrelevant because if the file won’t copy, it
    likely won’t ever copy (due to a media error, for example). That said, it’s
    worth looking at a few errors to see if the error messages are all the same. In
    that case there could be a problem with the source or possibly the robocopy
    arguments.

    If you want a much more robust way

    to extract robocopy errors from the log, consider using this powershell command
    script as discussed on this page.

    How to Log Robocopy Errors Only

    If you only want to log only errors from robocopy regardless of the error reason, you can use this method:

    robocopy [source] [destination] /copy:DT /w:1 /r:1 /nfl /ndl /njh /njs /ns /nc /np >> log.txt

    I hope that helps.

    Additional 1-on-1 Support: From Dennis

    If all of this is over your head, or if you’re having trouble setting up your
    NAS / copying files, etc — I can assist using

    my remote desktop support service. Simply
    contact me, briefly describing
    the issue and I’ll get back to you as soon as possible.

    Got a Computer Question or Problem? Ask Dennis!

    I need more questions. If you have a computer question — or even a computer
    problem that needs fixing please email me with your question
    so that I can write more articles like this one. I can’t promise I’ll respond to
    all the messages I receive (depending on the volume), but I’ll do my best.

    About the author: Dennis Faas is the owner and operator of
    Infopackets.com. With over 30 years of computing experience, Dennis’ areas of
    expertise are a broad range and include PC hardware, Microsoft Windows, Linux,
    network administration, and virtualization. Dennis holds a Bachelors degree in
    Computer Science (1999) and has authored 6 books on the topics of MS Windows and
    PC Security. If you like the advice you received on this page, please up-vote /
    Like this page and share it with friends. For technical support inquiries,
    Dennis can be reached via Live chat online this site using the Zopim Chat
    (currently located at the bottom left of the screen); optionally, you can
    contact Dennis through the website
    contact form.

    0 0 голоса
    Рейтинг статьи
    Подписаться
    Уведомить о
    guest

    0 комментариев
    Старые
    Новые Популярные
    Межтекстовые Отзывы
    Посмотреть все комментарии

    А вот еще интересные материалы:

  • Яшка сломя голову остановился исправьте ошибки
  • Ясность цели позволяет целеустремленно добиваться намеченного исправьте ошибки
  • Ясность цели позволяет целеустремленно добиваться намеченного где ошибка
  • Robocopy ошибка 123 0x0000007b
  • Robocopy ошибка 0 0x00000000