Access denied using attrib

19,513

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.
Share:
19,513

Related videos on Youtube

Redi
Author by

Redi

SOreadytohelp

Updated on September 18, 2022

Comments

  • Redi
    Redi almost 2 years

    I have a new Windows 7 system (migrating from XP). Need to copy some files from the old HDD, but am getting "access denied".

    I'd like to change permissions on all files/folders on the D drive, so I opened cmd and issued:

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

    This returns "Access denied" on every file it attempts to touch.

    What am I doing wrong?