Backup and Restore Permissions of File, Folder, or Drive in Windows  

    Backup and Restore Permissions of File, Folder, or Drive in Windows

    Backup and Restore Permissions of File, Folder, or Drive in Windows

    How to Backup and Restore Permissions of Files, Folders, or Drives in Windows
    Published by Category: Backup & Restore
    29 Jun 2023
    Designer Media Ltd

    How to Backup and Restore Permissions of Files, Folders, or Drives in Windows


    On NTFS and ReFS volumes, you can set security permissions on files and folders. These permissions grant or deny access to the files and folders.

    Every container (ex: folder) and object (ex: file) on the PC has a set of access control information attached to it. Known as a security descriptor, this information controls the type of access allowed to users and groups. The security descriptor is automatically created along with the container or object that is created.

    When you are a member of a group (ex: "Administrators") that is associated with an object, you have some ability to manage the permissions on that object. For those objects you own, you have full control.

    Permissions are defined within an object's security descriptor. Permissions are associated with, or assigned to, specific users and groups. For example, for the file Temp.dat, the built-in Administrators group might be assigned Read, Write, and Delete permissions, while the Backup Operators group might be assigned Read and Write permissions only.

    Each assignment of permissions to a user or group is represented in the system as an access control entry (ACE). The entire set of permission entries in a security descriptor is known as a permission set or access control list (ACL). Thus, for a file named Temp.dat, the permission set includes two permission entries, one for the built-in Administrators group and one for the Backup Operators group.

    There are two types of permissions: explicit permissions and inherited permissions.
    • Explicit permissions are those that are set by default on non-child objects when the object is created, or by user action on non-child, parent, or child objects.
    • Inherited permissions are those that are propagated to an object from a parent object. Inherited permissions ease the task of managing permissions and ensure consistency of permissions among all objects within a given container.
      • Inherited Deny permissions do not prevent access to an object if the object has an explicit Allow permission entry.
      • Explicit permissions take precedence over inherited permissions, even inherited Deny permissions.

    By default, objects within a container inherit the permissions from that container when the objects are created. For example, when you create a folder called MyFolder, all subfolders and files created within MyFolder automatically inherit the permissions from that folder. Therefore, MyFolder has explicit permissions, while all subfolders and files within it have inherited permissions.

    In Windows, you can back up the current permissions of a file, folder, or drive to a .txt file, and be able to restore the permissions later if needed.

    This tutorial will show you how to backup and restore permissions for files, folders, and drives in Windows 7, Windows 8, and Windows 10.

    While you must be signed in as an administrator to backup and restore permissions.


     CONTENTS:

    • Option One: To Backup Permissions of File, Folder, or Drive in Command Prompt
    • Option Two: To Restore Permissions of File, Folder, or Drive in Command Prompt





    OPTION ONE

    To Backup Permissions of File, Folder, or Drive in Command Prompt


    1. Open an elevated command prompt.

    2. Go the step below you want to do:

     3. Backup permissions of a file

    A) Type the command below into the elevated command prompt, press Enter, and go to Step 7.

    icacls "Full path of file" /save "%UserProfile%\Desktop\MyPermissions.txt"

    Note   Note
    Substitute Full path of file in the command above with the actual full path of the file with extension you want to back up the permissions of this file only.

    If you like, you can substitute MyPermissions in the command above with the name you want for the text file instead. This can make it easier to know what the .txt file is the backup for.

    For example: icacls "F:\MyFolder\Lock.png" /save "%UserProfile%\Desktop\MyPermissions.txt"

    Backup and Restore Permissions of File, Folder, or Drive in Windows-backup_permissions_of_file_command.png


     4. Backup permissions of a folder

    A) Type the command below into the elevated command prompt, press Enter, and go to Step 7.

    icacls "Full path of folder" /save "%UserProfile%\Desktop\MyPermissions.txt"

    Note   Note
    Substitute Full path of folder in the command above with the actual full path of the folder you want to back up the permissions of this folder only.

    If you like, you can substitute MyPermissions in the command above with the name you want for the text file instead. This can make it easier to know what the .txt file is the backup for.

    For example: icacls "F:\MyFolder" /save "%UserProfile%\Desktop\MyPermissions.txt"

    Backup and Restore Permissions of File, Folder, or Drive in Windows-backup_permissions_of_folder_command.png


     5. Backup permissions of a folder, subfolder and files

    A) Type the command below into the elevated command prompt, press Enter, and go to Step 7.

    icacls "Full path of folder" /save "%UserProfile%\Desktop\MyPermissions.txt" /t /c

    Note   Note
    Substitute Full path of folder in the command above with the actual full path of the folder you want to back up the permissions of this folder, subfolders and files.

    If you like, you can substitute MyPermissions in the command above with the name you want for the text file instead. This can make it easier to know what the .txt file is the backup for.

    For example: icacls "F:\MyFolder" /save "%UserProfile%\Desktop\MyPermissions.txt" /t /c

    Backup and Restore Permissions of File, Folder, or Drive in Windows-backup_permissions_of_folder_and_subfolders-files_command.png


     6. Backup permissions of a drive, subfolder and files

    A) Type the command below into the elevated command prompt, press Enter, and go to Step 7.

    icacls "Drive letter:\*" /save "%UserProfile%\Desktop\MyPermissions.txt" /t /c

    Note   Note
    Substitute Drive letter in the command above with the actual drive letter you want to back up the permissions of this drive, subfolders and files.

    If you like, you can substitute MyPermissions in the command above with the name you want for the text file instead. This can make it easier to know what the .txt file is the backup for.

    For example: icacls "F:\*" /save "%UserProfile%\Desktop\MyPermissions.txt" /t /c

    Backup and Restore Permissions of File, Folder, or Drive in Windows-backup_permissions_of_drive_command.png


    7. You will now have a MyPermissions.txt file saved to your desktop that is the permissions backup of the file, folder, or drive. You can move this text file to where you would like to keep it saved at.

    8. When finished, you can close the elevated command prompt if you like.






    OPTION TWO

    To Restore Permissions of File, Folder, or Drive in Command Prompt


    1. Open an elevated command prompt.

    2. Go the step below you want to do:

     3. Restore permissions of a file from backup

    A) Type the command below into the elevated command prompt, press Enter, and go to Step 6.

    icacls "Back one path from full path of file" /restore "Full path of MyPermissions.txt file"

    Note   Note
    Substitute Back one path from full path of file in the command above with the actual same full path of the file from the backup (ex: "F:\MyFolder\Lock.png"), but back one path (ex: "F:\MyFolder").

    Substitute Full path of MyPermissions.txt file in the command above with the actual full path of the text file with file extension created from step 3 in Option One.

    For example: icacls "F:\MyFolder" /restore "%UserProfile%\Desktop\MyPermissions.txt"

    Backup and Restore Permissions of File, Folder, or Drive in Windows-restore_permissions_of_file_command.png


     4. Restore permissions of a folder from backup

    A) Type the command below into the elevated command prompt, press Enter, and go to Step 6.

    icacls "Back one path from full path of folder" /restore "Full path of MyPermissions.txt file"

    Note   Note
    Substitute Back one path from full path of folder in the command above with the actual same full path of the folder from the backup (ex: "F:\MyFolder"), but back one path (ex: "F:").

    Substitute Full path of MyPermissions.txt file in the command above with the actual full path of the text file with file extension created from step 4 in Option One or step 5 in Option One.

    For example: icacls "F:" /restore "%UserProfile%\Desktop\MyPermissions.txt"

    Backup and Restore Permissions of File, Folder, or Drive in Windows-restore_permissions_of_folder_command.png


     5. Restore permissions of a drive from backup

    A) Type the command below into the elevated command prompt, press Enter, and go to Step 6.

    icacls "Back one path from full path of drive" /restore "Full path of MyPermissions.txt file"

    Note   Note
    Substitute Back one path from full path of drive in the command above with the actual same full path of the folder from the backup (ex: "F:\*"), but back one path (ex: "F:").

    Substitute Full path of MyPermissions.txt file in the command above with the actual full path of the text file with file extension created from step 6 in Option One.

    For example: icacls "F:" /restore "%UserProfile%\Desktop\MyPermissions.txt"

    Backup and Restore Permissions of File, Folder, or Drive in Windows-restore_permissions_of_drive_command.png

    6. When finished, you can close the elevated command prompt if you like.


    That's it,
    Shawn Brink






  1. Posts : 7,871
    Windows 11 Pro 64 bit
       #1

    I've built a new PC and some of the drive permissions differ. What are the default security permissions for a NFTS drive and how do you set them quickly?
      My Computers


  2. Posts : 68,672
    64-bit Windows 11 Pro for Workstations
    Thread Starter
       #2

    Steve C said:
    I've built a new PC and some of the drive permissions differ. What are the default security permissions for a NFTS drive and how do you set them quickly?
    Hello Steve,

    Since this drive is from another computer, you may just need to add your account to the permissions of the drive with "Full control" access. Inherited permissions from the drive should then allow you to access all files that use the inherited permissions.

    Change Permissions of Objects for Users and Groups in Windows 10
      My Computers


  3. Posts : 16,786
    Windows 10 Home x64 Version 22H2 Build 19045.4170
       #3

    Brink,

    In steps 5 & 6, you've accidentally written
    ,t ,c
    instead of
    /t /c


    Merry Christmas,
    Denis
      My Computer


  4. Posts : 68,672
    64-bit Windows 11 Pro for Workstations
    Thread Starter
       #4

    Try3 said:
    Brink,

    In steps 5 & 6, you've accidentally written
    ,t ,c
    instead of
    /t /c


    Merry Christmas,
    Denis
    Thank you Denis. Now corrected.
      My Computers


 

Tutorial Categories

Backup and Restore Permissions of File, Folder, or Drive in Windows Tutorial Index Network & Sharing Instalation and Upgrade Browsers and Email General Tips Gaming Customization Apps and Features Virtualization BSOD System Security User Accounts Hardware and Drivers Updates and Activation Backup and Restore Performance and Maintenance Mixed Reality Phone


  Related Discussions
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 08:25.
Find Us




Windows 10 Forums