Categories About Us Contact Us Become a Member

How to fix Windows error 5 (ERROR_ACCESS_DENIED)

This means Windows refused the action because the account running it lacks permission. Elevating or fixing permissions resolves it. Jump to your situation below or work through the methods in order.

By Neeraj Singh ~6 min Updated Jun 2026 88% found this helpful
Error message
Error 5: ERROR_ACCESS_DENIED. Access is denied.
Summary

Error 5 (ERROR_ACCESS_DENIED) means Windows blocked the action because the account performing it lacks the necessary permission. The common causes are running something that needs elevation from a normal (non-administrator) prompt or session, file or folder permissions that exclude your account, a service configured with a log-on account that has no rights to what it needs, or security software blocking the operation. The fix is to run the program or command as administrator, and if that is not enough, grant your account the right permissions or ownership of the file or folder, correct a service's log-on account, and check whether antivirus is intervening. Most everyday cases are solved simply by elevating; the rest come down to permissions.

What this error means

Windows guards files, folders, services and system actions with permissions. Error 5 is the access control system doing its job: the account trying to act does not have the right it needs, so the operation is refused.

The fix follows the cause. If the action needs administrator rights, elevating provides them. If a specific file or folder denies your account, adjusting its permissions or taking ownership grants access. A service may be running under an account without rights, and security tools can block actions that look risky.

Common causes

The action needs administrator rights but was not elevated.
File or folder permissions exclude your account.
A service's log-on account lacks the needed rights.
Security software is blocking the operation.
Ownership of the file or folder is wrong.
A policy restricts the action.
Expert insight

“Error 5 is the permissions wall. First question, did you run it as administrator? Half the time elevating is the whole fix. If not, then some specific file or folder is denying your account, so I check its Security tab, grant the right permissions, or take ownership if it is being stubborn. For a service, I look at which account it logs on as, because that account might not have rights to what it is touching. And occasionally antivirus is the one saying no.”

How to fix it

Method 1

Run as administrator

1Right-click the program or Command Prompt and choose Run as administrator.
2Approve the UAC prompt.
3Many error 5 cases need only this.
Method 2

Fix permissions or take ownership

1Right-click the file or folder, open Properties, Security, and ensure your account has the needed permissions.
2If access is blocked, use Advanced to take ownership, then grant Full control.
3Retry the action.
Method 3

Check a service's log-on account

1In services.msc, open the service's Properties, Log On tab.
2Confirm it uses an account with rights to what it needs (often Local System), and a correct password if a specific account.
3Restart the service.
Method 4

Test with security software paused

1Temporarily pause antivirus or endpoint security to see if it is blocking the action.
2If that resolves it, add an exception.
3Re-enable protection afterwards.
Method 5

Repair permissions-related corruption

1If system actions are denied, run an SFC and DISM repair:
sfc /scannow
DISM /Online /Cleanup-Image /RestoreHealth
2These fix damaged components that can cause access errors.

Error 5 is a permissions block, so try Run as administrator first, which fixes many cases. If access is still denied, adjust the file or folder permissions or take ownership, check a service's log-on account, and test with security software paused before re-enabling it.

Frequently asked questions

What does Windows error 5 mean?
ERROR_ACCESS_DENIED, access is denied. Windows blocked the action because the account performing it lacks the necessary permission or elevation.
How do I fix error 5?
Run the program or command as administrator first. If that does not help, fix the file or folder permissions or take ownership, check a service's log-on account, and test with antivirus paused.
How do I take ownership of a file?
Right-click it, open Properties, Security, Advanced, change the Owner to your account, then grant your account Full control under permissions, and apply.
Why does my service give error 5?
Its log-on account may lack rights to a file, folder or resource it uses. Check the service's Log On tab in services.msc and use an account with the needed rights and correct password.
Could antivirus cause error 5?
Yes. Endpoint security can block actions it deems risky, producing access denied. Test with it temporarily paused, and if that is the cause, add an exception and re-enable protection.
Does running as administrator always fix it?
No, but it fixes many cases. When it does not, the cause is usually specific file or folder permissions, a service log-on account, or security software rather than elevation.

Still not working?

If elevating and fixing permissions do not help, a corrupt security descriptor on the target or a restrictive policy may be involved. Comparing permissions against a working machine, or resetting them with icacls, can isolate it. You can also submit your error to us for a tailored fix.

Was this fix helpful? Thanks for your feedback!