Доступ запрещен с помощью attrib

12883
a coder

У меня новая система Windows 7 (переход с XP). Необходимо скопировать некоторые файлы со старого жесткого диска, но я получаю «доступ запрещен».

Я хотел бы изменить разрешения для всех файлов / папок на диске D, поэтому я открыл cmdи выдал:

attrib -r d:\*.* /s /d 

Это возвращает «Доступ запрещен» для каждого файла, к которому он пытается прикоснуться.

Что я делаю неправильно?

0

1 ответ на вопрос

2
Crippledsmurf

This is probably related to the NTFS permissions on the old drive (files) still reflecting the old system.

To fix this, try taking ownership of the files (try just one first and see if that works), the same procedure works for entire directories or drives.

  1. Right click a file or directory
  2. Click Properties from the menu
  3. Click the Security tab
  4. Click the Advanced button
  5. Click the Ownership tab
  6. Click Edit, Click OK if prompted by User Account Control.
  7. Select your user name from the "Change Owner To" list. If your user name isn't present, click the "Other users or groups" button and type your user name in the "Enter object name to select" box
  8. If changing a directory's ownership tick the "Replace owner on sub-containers and objects" checkbox to apply the changes to sub-folders and files in that directory if desired.
  9. Click OK
  10. Your user name should now appear in the "Change owner to" list. Select it from the list and click OK on each of the dialogs to close them.

Похожие вопросы