Windows 10 read only black square

windows 10 does not allow me to remove the read only checkbox in the properties of a directory.

Hi guys; I am learning programming, and I have encountered a problem that is related to the operating system and not to the programming, just to put them in context:

to program in php using symfony v5.3; requires being able to put write permissions to a specific folder ...

the related directory is: C:\xampp\htdocs\dev\p1\paguelofacil/var/cache/dev

this directory exists; you have the necessary users and the users have the read and write permissions; the problem is that no matter how much I try to change the read-only check-box it persists ...

I have tried everything that this other post says and I have not found a solution; even I do not receive any errors ... and in the post I do mention if there is an error ...

Windows 10 not able to remove read only atttribute of the folders

even run the following command if no result ...

attrib -r C:\xampp\htdocs\dev\p1\paguelofacil\var\*.* /s

If more information is needed, do not hesitate to request it.

Update:

To rule out that it is a user permissions problem or that it is a problem with the php script I have done the following:

  1. I have placed a patch [PHP] where I correct the write permission in the directory:
    echo 'Directory Exist '. $dir .'
'; echo get_current_user[].'
'; echo substr[sprintf['%o', fileperms[$dir]], -4].'
'; chmod [$dir, 755];

Output:

result of this: solve the problem in a bad way ...

if the user does not have the necessary permissions; PHP would have thrown a fatal error! with this patch the error is removed but it is not the correct thing.

This is not correct because I should not change permissions from my code ... it is assumed that the permissions must be on the properties and attributes of the directory.

if I remove the patch then the error will come up again; this tells me that it does not matter if I put the attribute or permission; this is lost ...

Let's clarify the following: in order to create files [any format] within a directory, we programmers must validate that within that directory we can write ... in Linux the directory must have at least 755 permissions; so I ask you where I can do something similar with Windows?

when we validate a directory, with is_writable if the directory has permissions 0555 it will spit out a false [you cannot write to this directory]; this permission is general; It is not associated with any user; In linux it is validated that the user / group is the owner of the directory too ... but I have already established this in windows it is assumed that by giving permissions to everyone, I am giving access to all users ...

If your folder keeps reverting to read-only it could be due to a recent Windows 10 upgrade. Many users have reported that when upgrading their system to Windows 10, they encountered this error. Read-only is a file/folder attribute that lets only a specific group of users read or edit the files or folder. This can get infuriating, however, the fix is quite simple and easy but may differ depending on the scenario that caused it.

Generally, when you encounter such an issue, you can easily overcome it by unchecking the read-only attribute box found in the properties of the file/folder. However, this case is not that simple. You won’t be able to change the read-only attribute of the file/folder which gets annoying. Nevertheless, this article will teach you how to access your files/folders again — just follow through with the instructions.

The folder reverts to read-only Windows 10

What causes the folder to revert to read-only on Windows 10?

This might be happening to you due to various reasons, nonetheless, the most generic ones are —

  • Windows upgrade. If you’ve recently upgraded your system to Windows 10, this might be occurring due to that as your account permissions may have been altered.
  • Account permissions. Sometimes, the error could be simply because of your account permissions which is the most common cause without you realizing it.

The possible and effective solutions for this problem are: –

Disable Controlled Access

Before we try other technical solutions, we will first try to disable the Controlled Folder Access in your settings. This is a hotfix and you may proceed with other solutions if this doesn’t work for you.

  1. Press and hold the “Windows Key + I” button to launch Windows Settings.
  2. Once the Settings are opened, navigate to Update & Security and then click on Windows Security.
  3. Now, under the Virus & threat protection settings, click on Manage settings.
    Virus & threat protection settings
  4. Under Controlled folder access, select Manage Controlled folder access and switch the access to Off.
    Manage Controlled folder access to Off
  5. Restart your computer completely and then check if the issue is resolved.

Log in as an Administrator

To start with the common mistake, if you have created multiple accounts on your system, make sure you are signed in as an administrator while accessing the file. The reason you are not able to read or edit the file/folder could be that the file/folder was created using an administrator account and you are trying to access it using a guest account or any other. Hence, before you move into the solutions mentioned below, make sure you are using the administrative account.

Change the Attribute of the Folder

If you are logged in as an administrator and still unable to access the files, then in such a case, you’ll have to change the attribute of the file using the command prompt. To do this, follow the given instructions:

  1. Press Winkey + X and select Command Prompt [Admin] from the list.
  2. To remove the read-only attribute and set a new attribute, use the following command:
    Enter the command to remove Read-only Attribute
attrib -r +s drive:\\
  1. The above command will remove the read-only attribute of the file and change it to a system attribute. However, some files/folders do not operate properly in the system attribute so use the following command if you want to remove the system attribute:
attrib -r -s drive:\\

Chủ Đề