NTFS is the standard file system of the Windows NT operating system family. Starting with Windows NT 4.0 Service Pack 6, it supported the concept of permissions which can be configured to permit or restrict access to files, folders, and other objects locally and over a network. Once you have configured permissions for a file or a folder, you may want to create a backup of them in order to restore them later or before you change them again.
As a user accesses each file, folder, registry key, printer, or an Active Directory object, the system checks its permissions. It supports inheritance for an object, e.g. files can inherit permissions from their parent folder. Also every object has an Owner which is the user account that can set ownership and change permissions.
If you are interested in managing NTFS permissions, refer to the following article:
How to take ownership and get full access to files and folders in Windows 10
For our task, we will use icacls.exe, the built-in console tool. It displays or modifies discretionary access control lists (DACLs) on specified files, and applies stored DACLs to files in specified directories.
Before proceeding, ensure that your user account has administrative privileges. Now, follow the instructions below.
To backup permissions in Windows 10, do the following.
- Open an elevated command prompt.
- Type or copy-paste the following command:
icacls "Path \ to \ file or folder" /save "C:\data\Permissions.txt"
Provide the path to your file or folder you want to backup the permissions for. Substitute the "C:\data\Permissions.txt" file path with the desired file name and path that is suitable for your computer.
- The next command will backup the permissions for the specified folder, it subfolders and all files.
icacls "Path \ to \ folder" /save "C:\data\permissions.txt" /t /c
The switches in the command are as follows:
/t - Performs the operation on all specified files in the current directory and its subdirectories.
/c - Continues the operation despite any file errors. Error messages will still be displayed.
The file permissions.txt is the permissions backup of your file or folder. Keep it in some safe place.
Now, let's see how to restore the permissions from the backup you made.
Restore File System Permissions in Windows 10
- Open an elevated command prompt.
- To restore the permissions for a file, type or copy-paste the following command:
icacls "Path \ to \ file" /restore "C:\data\permissions.txt"
Provide the path to your file you want to restore the permissions for. Substitute the "C:\data\Permissions.txt" portion with the actual file path which stores your permissions.
- To restore the permissions for a folder, type or copy-paste the following command:
icacls "Path \ to \ parent \ folder" /restore "C:\data\permissions.txt"
Substitute the "Path \ to \ parent \ folder" with the path to the parent folder that contains the folder you want to restore the permissions for. For example, if you target folder is 'c:\data\winaero', you should specify the path 'C:\data'.
- Add View Owner Context Menu in Windows 10
- Add View Permissions Context Menu in Windows 10
- How to restore the TrustedInstaller ownership in Windows 10
- How to take ownership and get full access to files and folders in Windows 10
Winaero greatly relies on your support. You can help the site keep bringing you interesting and useful content and software by using these options:
If you like this article, please share it using the buttons below. It won't take a lot from you, but it will help us grow. Thanks for your support!
One thought on “Backup Permissions For Files and Folders in Windows 10”
This icacls should have a full GUI in Windows!!