sodcalculator

10 Tech How-To

Fix System Error 5 Access Denied on Windows

Guide 10-49478 · Updated · Step by step

System error 5 (Access Denied) appears when Windows blocks a command or program because your current user account doesn’t have the required permissions. This guide walks you through the most common fixes, from running the command as an administrator to adjusting folder and service permissions, so you can get back to work quickly.

What You’ll Need

  • A Windows account with administrator privileges (you’ll need to enter an admin password or confirm a UAC prompt).
  • Access to the Command Prompt, PowerShell, or the program that triggered the error.
  • If the error occurs on a network share, know the share’s path and the credentials that should have access.

Step-by-Step

  1. Run the command as an administrator. The most common cause is that the command prompt or PowerShell isn’t elevated. Right-click on “Command Prompt” or “PowerShell” and select “Run as administrator.” If you see a User Account Control prompt, click “Yes.” Then try your command again.
  2. Check if the file or folder is read-only. Right-click the file or folder that’s causing the error, select “Properties,” and on the “General” tab, uncheck “Read-only” if it’s checked. Click “Apply” and “OK.” This can resolve access denied errors when trying to modify or delete files.
  3. Take ownership of the file or folder. If the read-only attribute isn’t the issue, you may need to take ownership. Right-click the item, select “Properties,” go to the “Security” tab, and click “Advanced.” Next to “Owner,” click “Change.” Type your username, click “Check Names,” then “OK.” Check the box “Replace owner on subcontainers and objects” if you’re dealing with a folder, then click “Apply” and “OK.”
  4. Grant your account full control permissions. After taking ownership, go back to the “Security” tab and click “Edit.” Select your username, then check “Full control” under “Allow.” Click “Apply” and “OK.” This gives your account the necessary permissions to access or modify the item.
  5. Disable or reconfigure User Account Control (UAC) temporarily (if safe). Some legacy programs or scripts fail when UAC is set to a high level. Open the Start menu, type “UAC,” and select “Change User Account Control settings.” Drag the slider down to “Never notify” (or lower it one notch), click “OK,” and restart your computer. Important: Lowering UAC reduces security; revert this after testing.
  6. Check service permissions. If the error occurs when starting or stopping a Windows service, open the Services console (press Win + R, type services.msc, and press Enter). Find the service, right-click it, select “Properties,” go to the “Log On” tab, and ensure the account has the “Log on as a service” right. You may need to use the “This account” option and enter credentials with the required permissions.
  7. For network shares, verify share and NTFS permissions. If you’re accessing a network drive, check both the share permissions (right-click the shared folder, select “Properties,” “Sharing” tab, “Advanced Sharing,” then “Permissions”) and the NTFS permissions (Security tab). Your user account must have “Read” or “Change” permission on the share and “Read” or “Write” on the NTFS level. Ask the network administrator if you’re unsure.
  8. Run the command with a different user account. If you’re using a standard user account, switch to an administrator account. You can also use the “Run as different user” option by holding Shift and right-clicking the program or command shortcut.
  9. Use the built-in Administrator account (as a last resort). If all else fails, enable the built-in Administrator account by opening an elevated Command Prompt and typing net user administrator /active:yes. Log out and log in as “Administrator” (no password by default). After fixing the issue, disable it again with net user administrator /active:no.

Common Mistakes

  • Not running the prompt as administrator. Even if you’re an admin, Windows still blocks elevated actions unless the program itself is run as administrator.
  • Changing permissions on system files. Modifying permissions on C:\Windows or Program Files can cause system instability. Only change permissions on the specific file or folder you need.
  • Forgetting to restart after ownership changes. Some permission changes only take effect after a restart or after closing and reopening the program.
  • Disabling UAC permanently. This can leave your system vulnerable and break modern Windows apps. Use it only as a temporary test.

Tips

  • Always try the simplest fix first—running as administrator solves the majority of cases.
  • When taking ownership, use the “Replace owner on subcontainers and objects” option for folders to avoid repeated errors on subfiles.
  • If the error occurs in a script or batch file, add runas /user:Administrator at the beginning, but be aware it will prompt for a password.
  • Document any permission changes you make; you may need to revert them later.

Troubleshooting

If the steps above don’t resolve the issue, try the following:

  • Check the exact error message. Sometimes the error includes the file or path that’s denied. Use that information to target your fixes.
  • Use Process Monitor. Microsoft’s Process Monitor (from Sysinternals) can show which specific permission is being denied. Run it, reproduce the error, and look for “ACCESS DENIED” entries to identify the exact object.
  • Verify group policy settings. If you’re on a corporate network, group policies may restrict certain actions. Contact your IT administrator.
  • Check if the file is locked by another process. Close any programs that might be using the file, then try again.
  • Run a disk check. Corrupted file system metadata can cause access denied errors. Run chkdsk /f in an elevated Command Prompt and restart.
  • Consider malware. In rare cases, malware can alter permissions. Run a full antivirus scan.

Frequently Asked Questions

Why do I get “Access Denied” even though I’m an administrator?

Windows uses User Account Control (UAC) to limit even administrator accounts. You must run the program or command “as administrator” to get elevated privileges.

How do I run Command Prompt as administrator?

Click the Start button, type “cmd,” right-click “Command Prompt,” and select “Run as administrator.” Confirm the UAC prompt.

Can I fix this by changing my account type to Administrator?

Yes, but it’s not always enough. Even administrator accounts are subject to UAC. You still need to right-click and select “Run as administrator.”

What does “Access Denied” mean on a network share?

It means your user account doesn’t have the necessary permissions on the shared folder or the NTFS file system. Contact the network administrator to grant access.

Is it safe to take ownership of system files?

It’s generally safe for files you need to access, but avoid changing permissions on entire system directories like C:\Windows. Doing so can break Windows.

I still get the error after following all steps. What else can I do?

Try using the built-in Administrator account (step 9). If that fails, consider using System Restore to revert to a point before the issue started.

Related

General steps for current mainstream versions; menus can differ by device and version. See the disclaimer or report an error.

More in this bed

The whole Tech How-To bed →