System Error 5 Has Occurred: Access Denied, Fixed
System error 5 has occurred, access is denied, is Windows telling you that the command, program or file you tried to use needs higher permission than your current account has. It is one of the most common Command Prompt errors, and it usually appears when you run a command such as net user, net localgroup or a system tool without administrator rights, or when your account is blocked from a protected folder or service. The good news is that system error 5 has occurred is almost always a permission problem, not a sign that Windows is broken.
In this guide you will learn what system error 5 means, why it appears, and how to fix it step by step, from running Command Prompt as administrator to checking your account type, User Account Control settings and file permissions. Work through the fixes in order, starting with the simplest, and test the command again after each one.
What Does System Error 5 Mean?
System error 5 is a Windows access-denied error. When a program asks Windows to do something that requires administrator permission, Windows checks your access token. If that token does not include administrator rights, or if the target folder, registry key or service denies your account, Windows stops the request and returns error 5. You may see the full message as System error 5 has occurred. Access is denied. in Command Prompt, or a shorter Access is denied message in File Explorer and other apps.
Common triggers include running Command Prompt or PowerShell as a standard user, trying to change another user account, starting or stopping a protected service, writing to C:\Windows, C:\Program Files or another system folder, and using a work or school account that is managed by an administrator. Malware protection and group policy can also block actions, but a missing administrator token is by far the most frequent cause.
Fix 1: Run Command Prompt as Administrator
- Close the Command Prompt window that showed the error.
- Click Start, type cmd, then right-click Command Prompt and choose Run as administrator.
- If User Account Control asks for permission, click Yes. If it asks for an administrator password, enter one for an account that has administrator rights.
- Check the title bar: it should say Administrator: Command Prompt.
- Run your command again.
If the command now works, the problem was simply elevation. Make a habit of opening an elevated prompt for system commands, rather than a normal one. You can also pin Command Prompt to the taskbar, right-click it, and choose Run as administrator whenever you need it.
Fix 2: Check That Your Account Is an Administrator
- Press Windows + I to open Settings, then go to Accounts and select Your info or Other users.
- Look under your name: it should say Administrator. If it says Standard user, you do not have the rights to run the command.
- On a personal PC, sign in with an administrator account, or ask the person who manages the PC to change your account type in Settings, Accounts, Other users.
- On a work or school PC, contact IT support instead of trying to bypass the restriction.
A standard account is deliberately limited, and that is a good security feature. It prevents accidental changes and limits malware, so do not change account types on a shared or managed computer without permission.
Fix 3: Take Ownership and Check Folder Permissions
If the error appears when you open, save or run a file, the folder permissions may be the problem. This is related to the permission errors covered in our guide to error opening file for writing fixes for Windows, which uses the same idea: the program must be allowed to write to that location.
- Right-click the folder or file, choose Properties, then open the Security tab.
- Click Edit, select your user name, and make sure the permissions you need, such as Modify or Full control, are allowed.
- If your name is missing, click Add, type your user name, and grant the needed permission.
- For a folder you own but cannot access, use Advanced, then Change next to Owner, enter your user name, and apply the change to subfolders and files.
- Try the action again.
Be careful with system folders. Granting yourself full control of C:\Windows or another protected folder can weaken security and break updates, so only change permissions for folders you created or for program folders you genuinely need to manage.
Fix 4: Adjust User Account Control and Try a Different Approach
User Account Control, or UAC, is the prompt that asks Yes or No before an administrator action. If UAC is disabled or set very low by group policy, some commands behave oddly, and if it is set very high, it may block scripts. Search for Change User Account Control settings, set the slider to the default level, restart the PC, and try again. Do not turn UAC off permanently as a fix, because that removes an important safety layer.
If a specific command still fails, check its spelling and syntax, and make sure the service or user name you typed actually exists. For example, net user with a misspelled name, or a service name that is not installed, can produce confusing errors. Running the command on the correct PC, with the correct account, matters just as much as elevation.
Fix 5: Check Services, Antivirus and Corrupt System Files
- Open Services by pressing Windows + R, typing services.msc and pressing Enter. Find the service you need, right-click it, and check that its log-on account and startup type are correct.
- Temporarily test with your antivirus paused only if you trust the command and the source, then turn protection back on straight away.
- In an elevated Command Prompt, run sfc /scannow and let it finish, then restart the PC.
- If the error started after a recent change, use System Restore to return to a point before that change.
For wider PC problems, our PC troubleshooting guide walks through the same systematic approach: identify the last change, test the simplest cause first, and only then move to deeper repairs. A related Windows sign-in error is covered in our guide to the PIN isn’t available fix, which is useful if permission problems also affect logging in.
Safety Notes
Never run commands copied from an untrusted website in an elevated Command Prompt without understanding them. An administrator prompt can change accounts, services and system files, so a malicious command can do far more damage there than in a normal window. Back up important files before changing permissions, services or system settings, and create a restore point if you are about to make a larger change.
Frequently Asked Questions
What is system error 5?
System error 5 is a Windows access-denied error. It means the account or program that tried an action does not have the administrator permission needed for that action, folder, service or account change.
How do I fix system error 5 in Command Prompt?
Close the normal Command Prompt, right-click Command Prompt in Start, choose Run as administrator, approve the User Account Control prompt, and run the command again in the elevated window.
Why do I get access denied even though I am the only user?
Windows still separates standard and administrator rights, even on a single-user PC. A normal Command Prompt runs with a standard token, so system commands need an elevated prompt, even if your account is an administrator account.
Can I turn off User Account Control to fix error 5?
You can lower UAC, but it is not a safe permanent fix and it does not give a standard account administrator rights. Keep UAC at its default level and use Run as administrator for system commands instead.
Is system error 5 caused by a virus?
Usually no. It is normally a permission issue. If the error appears suddenly, alongside other strange behaviour, run a full antivirus scan and check for recent software or policy changes before assuming the worst.
[…] System Error 5 Has Occurred: Access Denied, Fixed […]