Как изменить атрибуты папки в windows 10

Все способы:

  • Что нужно знать
  • Способ 1: Изменение атрибутов
  • Способ 2: Получение прав доступа
    • Замена владельца
  • Вопросы и ответы: 3

Что нужно знать

Все папки в Windows 10, даже только что созданные и пустые, имеют в свойствах отметку «Только для чтения» в виде черного квадрата. Наличие этой метки не означает, что сама папка или имеющиеся в ней файлы недоступны для записи, она служит для визуализации установки или удаления атрибута «Только для чтения» только в момент совершения действия. Поэтому после изменения атрибутов и повторного открытия свойств объекта чекбокс «Только для чтения» все равно будет отмечен черным квадратом. Принимать меры, о которых будет сказано ниже, имеет смысл только в том случае, если при попытке записи в папку или файл появляется ошибка доступа.

Способ 1: Изменение атрибутов

Если файл или папка доступны только для чтения, для начала попробуйте изменить их атрибуты NTFS. Сделать это можно средствами консоли.

  1. Запустите «PowerShell» или классическую «Командную строку» от имени администратора из контекстного меню кнопки «Пуск».
  2. Не убирается галочка только чтение в Windows 10-1

  3. Выполните команду получения атрибутов attrib путь_к_папке или файлу. Если команда вернет значение R, значит, для объекта установлен атрибут «Только для чтения».
  4. Не убирается галочка только чтение в Windows 10-2

  5. Удалите его, выполнив команду attrib -R путь_к_папке или файлу.
  6. Не убирается галочка только чтение в Windows 10-3

Проверьте, снялся ли флажок «Только для чтения» с обработанного объекта.

Способ 2: Получение прав доступа

Более эффективным решением проблемы является получение на доступный только для чтения объект полных прав доступа с изменением либо без изменения владельца.

  1. Откройте «Свойства» папки или файла из контекстного меню.
  2. В открывшемся окне свойств переключитесь на вкладку «Безопасность» и нажмите кнопку «Дополнительно».
  3. Не убирается галочка только чтение в Windows 10-4

  4. В окне «Дополнительные параметры безопасности» выберите текущую учетную запись или имя пользователя и нажмите кнопку «Отключение наследования».
  5. Не убирается галочка только чтение в Windows 10-5

  6. Нажмите «Преобразовать унаследованные разрешения в явные разрешения этого объекта».
    Сохраните настройки.
  7. Не убирается галочка только чтение в Windows 10-6

  8. После этого настройки доступа должны стать доступными. Нажмите в окне свойств файла или папки кнопку «Изменить».
  9. Не убирается галочка только чтение в Windows 10-8

  10. Выберите в списке нужного пользователя, отметьте флажком опцию «Полный доступ» и сохраните настройки.

После этого можно будет пробовать снять отметку «Только для чтения» в свойствах на вкладке «Общие».

Замена владельца

Если владельцем файла или папки является «СИСТЕМА», «TrustedInstaller» или другая системная служба, возможно, потребуется замена владельца.

  1. Откройте «Дополнительные параметры безопасности» как было показано в предыдущем способе (см. шаги 1 и 2).
  2. Нажмите ссылку «Изменить» напротив имени владельца объекта.
  3. Не убирается галочка только чтение в Windows 10-10

  4. Появится небольшое окошко выбора пользователя или группы. Введите в поле имен выбираемых объектов имя текущего или нужного пользователя, нажмите «Проверить имена» и «OK».
  5. Не убирается галочка только чтение в Windows 10-11

Заменив владельца, получите полные права на объект, воспользовавшись уже знакомыми инструкциями из предыдущего способа. Если снять галочку «Только для чтения» не удается, попробуйте сделать в безопасном режиме. Также для этих целей можно использовать загрузочные диски на базе WinPE, например WinPE 11-10-8 Sergei Strelec.

Читайте также: Вход в безопасный режим в Windows 10

Наша группа в TelegramПолезные советы и помощь

Несколько раз на сайте и по другим каналам ко мне обращались с вопросом: Как снять атрибут «Только для чтения» с папки в Windows? Обычно следовало пояснение: «Я убираю отметку только для чтения, применяю настройки, снова открываю свойства папки — вижу, что папка снова только для чтения — что делать?».

В этой статье для начинающих пользователей подробно об отметке «Только для чтения» в атрибутах папки в Windows, можно ли её снять, о том, почему она возвращается после того, как была убрана и дополнительная информация на тему.

Атрибут «Только для чтения» в свойствах папки в графическом интерфейсе Windows

Вопрос о том, как снять «Только для чтения» с папки в Windows 11, Windows 10 или другой версии ОС возникает из-за непонимания назначения этой отметки в атрибутах свойствах папки.

Атрибут Только для чтения в свойствах папки Windows

Несмотря на то, что прямо в окне свойств указано «Применимо только к файлам в папке», пользователи ошибочно делают одно из следующих предположений, увидев там стандартный «квадрат» или слегка изменившуюся отметку в Windows 11:

  1. Установленная отметка сообщает о том, что папка только для чтения.
  2. Отметка «Только для чтения» говорит о том, что какое-то содержимое в папке имеет атрибут «Только для чтения».

В действительности, любая, даже только что созданная и полностью пустая папка в Windows 11/10/8.1/7 будет иметь установленную отметку (квадрат или минус), если открыть её свойства и посмотреть раздел «Атрибуты», при этом важно знать:

  • Когда вы открываете свойства папки, имеющиеся в ней файлы никак не анализируются на наличие тех или иных атрибутов — отметка не несёт информации о наличии в папке файлов «Только для чтения» или об атрибутах самой папки.
  • Назначение отметки — снять атрибут «Только для чтения» с имеющихся внутри папки файлов, или, наоборот, установить его. При этом, когда вы повторно откроете свойства папки, там снова будет та же отметка — независимо от того, есть ли внутри что-то «Только для чтения» или нет.
  • Если вы убирали «Только для чтения» и применяли изменение атрибутов ко всем вложенным элементам, при этом никаких ошибок в процессе не было — значит в папке не осталось элементов «Только для чтения», а любые проблемы с изменением или удалением как папки, так и файлы, вероятнее всего связаны с правами доступа.
    Применить изменение атрибута Только для чтения к папке

Как снять атрибут «Только для чтения» с папки

Папка в Windows всё-таки может иметь установленный атрибут «Только для чтения», но в окне свойств вы его не увидите. Вместо этого можно использовать командную строку:

  1. Запустите командную строку (от имени Администратора, если папка требует прав администратора для её изменения).
  2. Введите команду
    attrib путь_к_папке

    и нажмите Enter. Если результат выглядит как на изображении ниже, у папки нет атрибута «Только для чтения».

    Атрибут Только для чтения отсутствует

  3. Если вы видите «R» в результате выполнения команды — атрибут «Только для чтения» установлен.
    Папка Только для чтения в Windows

  4. Чтобы снять его, можно использовать команду
    attrib -R путь_к_папке
    Убрать атрибут Только для чтения с папки Windows

Надеюсь, инструкция как-то прояснила ситуацию и помогла разобраться.

File attributes are special metadata or properties of files stored in the file system which instruct computer software to change its behavior. Some of them may be enforced by operating system. For example, the read-only attribute prevents apps from writing to such files and tells File Explorer to warn the user that the file or folder can be important. The console DEL command doesn’t remove files with the read-only attribute. In this article, we will review different methods to change file attributes in Windows 10.

Windows 10 offers the user a number of methods to change file system attributes for folders and files. Each attribute can have only one state at a moment: it can be set or disabled. While file attributes are part of file system metadata, they always considered separate from other metadata values like file date or permissions.
In Windows 10, you can use File Explorer (both the Ribbon option and the File Properties dialog), PowerShell, and the good old command prompt to modify or set file attributes. Let’s review each method in detail.

  1. Open File Explorer and go to the folder that contains your files.
  2. Select the file whose attributes you want to change.
  3. On the Home tab of the Ribbon, click on the Properties button.
    File Explorer Properties Button

  4. In the next dialog, under Attributes, you can set or remove the Read-only and Hidden attributes.
    File Properties Dialog Windows 10

  5. Click on the Advanced button to set or clear extra attributes available for the file.
    File Properties Advanced Attributes Windows 10

You are done.

The extra file attributes include:

  • File is ready for archiving.
  • Allow this file to have contents indexed in addition to file properties.
  • Compress file contents to save disk space.
  • Encrypt contents to secure data.

Tip: You can open the File Properties dialog using the context menu. Right-click a file and select the Properties command. Also, you can quickly open the file properties if you press and hold the Alt key and double-click the file or press Enter. See the article:

How to open file or folder properties quickly in Windows File Explorer

For the «Hidden» attribute, one more way is to use the button Hide selected items in the View tab of the Ribbon. See the following article:

How to hide and unhide files quickly in Windows 10.

Change file attributes with PowerShell

It is possible to change file attributes using the PowerShell console. There are a couple of cmdlets which can be used to view, set, or remove them. Here is how you can use them.

Open a new PowerShell console and use the following commands.

To view file attributes with PowerShell, run the following cmdlet:

Get-ItemProperty -Path path_to_file

Replace the path_to_file with the actual path to your file. The command will print all the attributes for the file.

PowerShell Get File Attributes

To view all of the information that is available, combine the output with the Format-List cmdlet, as shown below:

Get-ItemProperty -Path path_to_file | Format-list -Property * -Force

This will show more details about your file.

PowerShell Get File Attributes More Details

To change file attributes with PowerShell, run the following cmdlet:

Set-ItemProperty -Path path_to_file -Name IsReadOnly -Value True

This will set the ReadOnly attribute for the specified file.

PowerShell Set File Attributes

The possible values for the -Name argument are as follows:

  • Archive
  • Hidden
  • Normal
  • ReadOnly
  • System

Set the appropriate value to True to set the attribute. A value of False will clear the attribute.

Change file attributes using Command Prompt

The command prompt comes with a console attrib command which allows managing file attributes. It supports the following attributes:

R Read-only file attribute.
A Archive file attribute.
S System file attribute.
H Hidden file attribute.
O Offline attribute.
I Not content indexed file attribute.
X No scrub file attribute.
V Integrity attribute.
P Pinned attribute.
U Unpinned attribute.
B SMR Blob attribute.

Each attribute can be set using the syntax like this (for example, for read-only attribute):

attrib +R path_to_file

To remove the attribute, you can use the following command:

attrib -R path_to_file

So, «+» sets an attribute, and «-» clears an attribute.

For example, here is how to set a hidden attribute using the command prompt.

Change the hidden attribute using the command prompt

  1. Open a new command prompt window.
  2. Type the following command to set the hidden attribute:
    attrib +H c:\data\myfile.txt

    Command Prompt Set File Attributes

  3. To remove the attribute, use the command:
    attrib -H c:\data\myfile.txt

    Command Prompt Remove File Attributes

You are done. For more information, run the attrib command as follows:

attrib /?

That’s it.

Support us

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!

File attributes are some settings options that determine whether a user or the operating system has permission to access and modify the files or not. It is quite a simple and straightforward approach to changing the file state.

Changing file attributes help you to safeguard your files from unwanted issues.

how-to-change-file-attributes-in-windows 10-11-s

If other people have access to your computer, you need to ensure no one modifies your files. You can simply set the files to read-only mode to prevent others from modifying them. You can set the file attributes to be hidden so that no one can find them.

Well, in this article, I will guide you to change the file attributes on Windows 10/11. So without wasting any time, let’s get started!

Types of File Attributes

There are different types of attributes for files that you can find. But you can use a few from the properties menu of that file.

Here is the list of different file attributes:

Attributes What they do
Archive (A) It shows if the file has been modified since the last update
Hidden (H) You can hide any files from displaying on the File Explorer
System (S) Which indicates the file is crucial to the operating system
Read-only (R) It only gives permission to read the file
Compressed (C) It will compress the files automatically if the attribute is enabled
Encrypted (E) When enabled, your files will be encrypted
Directory (D) This will indicate the file as a subdirectory
Offline (O) Your files will be moved to the offline storage
Temporary (T) It indicates if the file is used for temporary storage

Check out the easiest way to Fix Windows 11 File History Element Not Found Error.

There are three file attribute-changing methods available out there. All of them are pretty easy but using the properties contextual menu is the most popular one. You can use any of them to change the file attributes.

Here are the methods to change the file attributes:

This is the most used method among all. You will need a minute to change the attributes of your files.

Here is how you can change file attributes using the properties menu:

Here’s a complete guide on how to Disable File Compression on Windows 11/10.

2. Use Powershell

You can use Windows Powershell to change the file attributes. There are some cmdlets available that you can use to view, set, or remove them.

Here are the steps to change file attributes using Powershell:

  • Press Windows + X and open Windows Powershell.
  • Run the following cmdlet to view file attributes on Powershell. *

Get-ItemProperty -Path path_to_file

  • Run the following cmdlet to view all available information and combine the output. *

Get-ItemProperty -Path path_to_file | Format-list -Property * -Force

  • Run the following cmdlet to change file attributes. *

Set-ItemProperty -Path path_to_file -Name IsReadOnly -Value True

Quick Note: replace the ReadOnly with Archive, Hidden, Normal, and System, according to your need

*Note: replace the path_to_file with your actual file path.

Read more on how to Password Protect a File or Folder in Windows 11.

3. Use Command Prompt

The command prompt can change the file attributes using the command attrib. It comes prebuilt in the command prompt.

Here is how you can change attributes of files using Command Prompt:

  • Type Windows + R to open Windows Run.
  • Type cmd and hit Enter.
  • Use the following command to change the attribute to Read-only. *

attrib +R path_to_file

  • Type the following command to remove the Read-only attribute. *

attrib -R path_to_file

You can replace the R with other attributes according to your need. R or Read-only is used as an example.

*Quick Note: replace the path_to_file with your actual file path.

Related guide: Enable or Disable Offline Files in Windows 11.

Frequently Asked Questions

How do I change file attributes on a Mac?

You can change the file attributes on Mac by following the method:

Select a file > Get Info > click the drop-down arrow > select a user group > change the attributes.

What are 4 common file attributes for Windows?

In the file system directories, file attributes are maintained. You can typically find four common file attributes that are, Read-only, Hidden, System, and Archive.

How can files be protected?

You can use different methods to access any files. However, the most straightforward way of protecting the files is to associate Identity-dependent access with all the files and directories, called an access-control list, aka ACL. It shows the names of the users and the access to files that associate with each user.

Final Thoughts

That’s all from me. You can quickly change the file attributes by following any of those three methods. No matter which way you choose, your job will be done in no time.

Thanks for reading this article. Feel free to share any queries in the comment section below. I’ll try my best to resolve that.

Signing out.


Farhan Max

Farhan Max is a tech geek with a particular interest in computer hardware. He’s been fascinated by gaming since childhood and is now completing his undergraduate studies while researching and testing the latest tech innovations. Alongside his love for all things geeky, Farhan is also a skilled photographer.

Команда attrib предназначена для просмотра или изменения атрибутов файлов и папок через командную строку Windows. Данная программа доступна в Windows 10, Windows 7, Windows XP и в более старых версиях Windows. В данной статье мы рассмотрим синтаксис, параметры и примеры использования этой команды.

Содержание

Синтаксис команды attrib

Синтаксис команды attrib выглядит следующим образом:

attrib [{+|-}r] [{+|-}a] [{+|-}s] [{+|-}h] [{+|-}i] [<drive>:][<path>][<filename>] [/s [/d] [/l]]

Где

+a

-a

Добавляет/удаляет атрибут «Архивный» для файла или каталога.
+h

-h

Добавляет/удаляет атрибут «Скрытый» для файла или каталога.
+i

-i

Добавляет/удаляет атрибут «Не проиндексировано» для файла или каталога.
+r

-r

Добавляет/удаляет атрибут «Только для чтения» для файла или каталога.
+s

-s

Добавляет/удаляет атрибут «Системный» для файла или каталога.
+i

-i

Добавляет/удаляет атрибут «Не проиндексировано» для файла или каталога.
[<drive>:] [<path>] [<filename>] Путь к папке или файлу.
/s Включает обработку файлов и папок в текущем каталоге и в подкаталогах.
/d Включает обработку файлов и папок.
/l Включает обработку самой символической ссылки, а не ее цели.
/? Просмотр справки

Как пользоваться командой attrib

Для того чтобы просмотреть атрибуты для всех файлов в текущей папке достаточно просто выполнить команду «attrib» без каких-либо параметров.

attrib

команда attrib

Для того чтобы получить информацию не только о файлах, но и папках, добавляем параметр «/d».

attrib /d

атрибуты файлов и папок

Для просмотра атрибутов конкретного файла или папки нужно указать их название или полный путь. Если файл или папка содержит пробелы, то название нужно брать в двойные кавычки.

attrib /d folder

attrib file.txt

просмотр атрибутов конкретного файла

Чтобы добавить какой-либо атрибут нужно указать соответствующий параметр со знаком «плюс». Например, для того чтобы добавить «Только для чтение» нужно использовать «+r». Удаление атрибута выполняется аналогичным способом, только со знаком минус.

attrib +r c:\temp2\file.txt

attrib -r c:\temp2\file.txt

добавить атрибут

При добавлении или удалении атрибутов для папок всегда нужно использовать параметр «/d».

attrib +h c:\temp2\folder /d

attrib -h c:\temp2\folder /d

добавить атрибут для папок

Примеры использования attrib

При необходимости, с помощью команды «attrib» можно добавлять и удалять сразу несколько атрибутов за раз. Ниже приведено несколько примеров такого использования данной команды.

Добавляем атрибуты «Системный», «Скрытый», «Только для чтения» и для файла «c:\file.txt».

attrib +s +h +r c:\file.txt

Удаляем атрибуты «Системный», «Скрытый», «Только для чтения» для файла «c:\file.txt».

attrib -s -h -r c:\file.txt

Добавляем атрибуты «Системный», «Скрытый», «Только для чтения» для всех файлов в папке «c:\temp2»

attrib +s +h +r c:\temp2\*

Удаляем атрибуты «Системный», «Скрытый», «Только для чтения» для всех файлов в папке «c:\temp2»

attrib -s -h -r c:\temp2\*

Добавляем атрибуты «Системный», «Скрытый», «Только для чтения» для всех файлов и папок в папке «c:\temp2»

attrib +s +h +r c:\temp2\* /d

Удаляем атрибуты «Системный», «Скрытый», «Только для чтения» для всех файлов и папок в папке «c:\temp2»

attrib -s -h -r c:\temp2\* /d

Добавляем атрибуты «Системный», «Скрытый» для всех файлов и папок в папке «c:\temp2», а также для всех вложенных папок и файлов.

attrib +s +h c:\temp2\* /d /s

Удаляем атрибуты «Системный», «Скрытый» для всех файлов и папок в папке «c:\temp2», а также для всех вложенных папок и файлов.

attrib -s -h c:\temp2\* /d /s

Ошибки при использовании команды attrib

Если при попытке изменить атрибуты вы получаете ошибку «Ошибка в формате параметра», то скорее всего проблема в том, что файл или папка содержит пробелы. Для решения этой проблемы нужно просто взять путь к файлу или папке в двойные кавычки.

Еще одна возможная проблема – ошибка «Доступ запрещен». В этом случае для изменения атрибутов нужно запустить командную строку с правами администратора либо изменить права доступа к данному файлу.

Автор
Александр Степушин

Создатель сайта comp-security.net, автор более 2000 статей о ремонте компьютеров, работе с программами, настройке операционных систем.

Остались вопросы?

Задайте вопрос в комментариях под статьей или на странице
«Задать вопрос»
и вы обязательно получите ответ.

Понравилась статья? Поделить с друзьями:
0 0 голоса
Рейтинг статьи
Подписаться
Уведомить о
guest

0 комментариев
Старые
Новые Популярные
Межтекстовые Отзывы
Посмотреть все комментарии
  • Install arch linux from windows
  • Что будет если удалить содержимое папки temp в windows 10
  • Звук восклицания windows xp
  • Система архивации данных windows server чтение данных
  • Python no module named pip windows