Interesting

You do not have permission to open this file. Contact the owner or administrator

User question

Hello!

I need to edit the "hosts" file, but I cannot do this because when opening a file, I see an error: "There is no permission to open this file. Please contact the owner or administrator." What can be done?

I completely checked the system with an antivirus (Doctor Web), found no viruses ...

Hello!

Well, in the overwhelming majority of cases, this happens due to some settings in Windows, viruses and security programs that block access to many system files (for example, antiviruses, no matter how strange it may sound).

By the way, as far as Dr.Web is concerned, its cure utility CureIT often blocks access to the file.hosts.

Below, I will consider how to fix everything ...

*

And so, what to do with it (with an error ...)

An approximate view of the error that pops up when something like this is shown in the screenshot below. Note that such an error can pop up when editing any files and programs.

Error appearance

1) We allow everyone to do everything through the file properties

Right-click on the file (which does not want to open), and in the context menu, select properties .

Next, open the "Security" tab (if there is an "Advanced" button, as in the screenshot below, click on it).

File properties

Then check the boxes in all columns, allowing both reading, writing, and editing for all user groups. Save your changes.

We allow everything ...

In most cases, the error should be gone ...

2) Trying to change access via the command line

An identical * operation can be performed using the command line. To do this, you need to run it as administrator .

Reference! How to run the command line (including as an admin) - //ocomp.info/kak-otkryit-komandnuyu-stroku.html

Next, you need to use the following command (when asked if you are sure, answer in the affirmative):

cacls.exe C: \ WINDOWS \ system32 \ drivers \ etc \ hosts / C / G SYSTEM: F All: F

An example of such an operation is presented below.

Change file permissions via the command line

For reference!

The CACLS command is used to view and modify Access Control Lists (ACLs) for files. CACLS is considered somewhat outdated, however it still works today!

3) We check security programs (antiviruses, protective utilities)

Some antiviruses, and especially anti-malware programs, can block access to some system files. For example, if you touch the same hosts - then very many utilities block access to it (for example, Malwarebytes, AVG, Panda (when max. protection is activated), Doctor Web, etc.).

Try to disable or remove such software for a while.

Malwarebytes on guard of the system

By the way, most antiviruses can be easily disabled for an hour or two through the tray icon.

Disable Avast antivirus for 1 hour

4) UAC ... (User Account Control)

Another point: when activating maximum protectionUAC (this is a special module in Windows to control all significant changes in the system) - it can become so that you cannot change some of the files (in general, this does not happen so often, because the slider is manually twisted to the maximum, which means you would be aware ...) .

To adjust the "sensitivity" of UAC - open the Windows Control Panel, then the section "User Accounts", and again the tab of the same name (see the screenshot below).

User accounts

Then click on the link "Change User Account Control Settings".

Change User Account Control Settings

Then just drag the slider down to lower the level of control. (mode: "never notify" means that UAC will not notify you about changes made by you or applications. This option disables UAC!) .

We reduce the level of control (after checking - return the slider to its original place)

Save changes and test system operation. After eliminating the error, restore the parameters that you changed.

*

Additions on the topic are welcome ...

Good luck!

$config[zx-auto] not found$config[zx-overlay] not found