Changing permissions on multiple files at once (Windows 10)

B Obey 1 Reputation point
2023-01-08T07:28:09.027+00:00

Hey everyone! I need some assistance with figuring out how to change the permissions on multiple files at once. I recently had to reload my computer, and pulling files back onto my local disk from my SSD is sending me into an error loop of "access denied". I was able to finally get the files back onto my local disk, but all of the files remain inaccessible due to being "locked" behind an administrator that no longer exists on this PC.

The only fix I'm seeing is going into the security properties and selecting a principal for each file. However, there are tens of thousands of files that need to be unlocked via this method, and I'm not seeing any way of changing permissions on multiple files simultaneously. I just don't see this being viable time management, so I'm really hoping someone here has an alternative method for me. Thanks so much!

Windows 10
Windows 10
A Microsoft operating system that runs on personal computers and tablets.
10,866 questions
Windows 10 Setup
Windows 10 Setup
Windows 10: A Microsoft operating system that runs on personal computers and tablets.Setup: The procedures involved in preparing a software program or application to operate within a computer or mobile device.
1,913 questions
Windows 10 Security
Windows 10 Security
Windows 10: A Microsoft operating system that runs on personal computers and tablets.Security: The precautions taken to guard against crime, attack, sabotage, espionage, or another threat.
2,786 questions
{count} votes

5 answers

Sort by: Most helpful
  1. MotoX80 32,331 Reputation points
    2023-01-08T18:18:59.847+00:00

    Open a command prompt with "run as administrator". Run takeown against the folder.

    takeown /d Y /a /r /f c:\MyData\BYourBadFolderName  
    

    Do NOT run that against the entire C:\ drive.

    Then use the Explorer to replace the permissions on all subfolders and files.

    277242-image.png

    3 people found this answer helpful.

  2. Jason DaSilva 5 Reputation points
    2024-02-29T19:40:08.8066667+00:00

    MotoX80's post didn't seem to work for me.

    This did however. It was quick and easy and worked on all my files in a particular folder.

    Run Command Prompt as Administrator:

    • Press Windows + X and select “Command Prompt (Admin)” or “Windows PowerShell (Admin)”.

    Navigate to Your Video Folder:

    • Use the cd command to navigate to the folder containing your video files. For example:

    cd F:\1-Drive Copy of Acer\Al Brooks Course\Al Brooks Course

    Reset Permissions:

    • Run the following command to reset permissions for all files and subfolders within the directory: icacls * /reset /T /C

    Assign Ownership:

    • Next, set yourself as the owner of the folder and its contents: icacls * /setowner "YourUsername" /T /C Replace "YourUsername" with your actual Windows username. I used the word "Users" so it's accessible to anyone on my computer.

    Grant Full Control Permissions:

    • Finally, grant full control permissions to your user account: icacls * /grant "YourUsername:(F)" /T /C Again, replace "YourUsername" with your actual username.

    Check Permissions:

    • Confirm that the permissions have been applied by right-clicking on the folder, selecting “Properties”, and going to the “Security” tab.
    1 person found this answer helpful.

  3. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.

    1 deleted comment

    Comments have been turned off. Learn more

  4. Tom Knezevich 0 Reputation points
    2024-01-16T16:27:07.53+00:00

    I tried using: takeown /d Y /a /r /f c:\Documents\Word Documents and received this error message: C:>takeown /d Y /a /r /f c:\Documents\Word Documents ERROR: Invalid argument/option - 'Documents'. Type "TAKEOWN /?" for usage. Any suggestions as to what I am doing wrong? Thanks very much!


  5. Alex Montero 0 Reputation points
    2024-05-13T13:20:31.9833333+00:00

    From another chat. This was by far the simplest solution. Replace the "Photo" folder mentioned below with whatever files/folder you need to change permissions on:

    Take Ownership of the Entire Photo Folder:

    Right-click on the folder containing the photos and select "Properties."

      Go to the "Security" tab and click on "Advanced."
      
         Click on "Change" next to the owner's name and type your username in the box, then click "Check Names" and "OK."
         
            Check the box that says "Replace owner on subcontainers and objects" and click "Apply" and then "OK."
            
            **Change Permissions for the Entire Folder**:
            
               Go back to the "Security" tab in the folder's properties and click "Edit."
               
                  Select your user account from the list and click "Edit."
                  
                     Check the box that says "Full Control" and click "Apply" and then "OK."
                     
                     **Apply Permissions to All Files and Subfolders**:
                     
                        Once you have taken ownership and changed the permissions for the entire folder, you can apply these changes to all files and subfolders within it.
                        
                           Go back to the "Security" tab and click "Advanced."
                           
                              Check the box that says "Replace all child object permission entries with inheritable permission entries from this object" and click "Apply" and then "OK."
                              
    

    By following these steps, you should be able to take ownership of the entire photo folder, change the permissions for the folder and its contents, and ensure that you have access to all the photos within it.

    Please note that changing security permissions can have implications for the security and privacy of your files, so exercise caution and ensure that you are comfortable with the changes you are making.

    0 comments No comments