Encountering the “System error 5 has occurred. Access is denied.” message in Windows can be frustrating, especially when trying to execute administrative commands. This error typically occurs when a command is run without the necessary administrative privileges.
C:\Users\XXXX>net stop WuAuServ
System error 5 has occurred.
Access is denied
In this guide, we will explore the causes of this issue and the steps to fix it.
What Causes System Error 5?
The “System error 5 has occurred” message is primarily caused by the following:
- Lack of Administrative Privileges – Running commands without elevated permissions triggers this error.
- User Account Control (UAC) Restrictions – Windows restricts certain commands for security reasons.
- Limited User Account Rights – The logged-in account might not have administrator rights.
- Incorrect Permissions on Files or Folders – Some files and directories require elevated access to modify.
How to Fix System Error 5 in Windows
1. Run Command Prompt as Administrator
Most often, the error occurs because the command prompt is not run with administrative privileges. To fix this:
- Click on the Start menu.
- Type
cmd
in the search bar. - Right-click on Command Prompt and select Run as administrator.
- Click Yes in the User Account Control (UAC) prompt.
- Try running your command again.
2. Ensure Your Account Has Administrative Privileges
If running the command prompt as an administrator doesn’t solve the issue, ensure your account has the necessary rights:
- Open Settings and go to Accounts.
- Click on Your Info.
- Check if your account is labeled as “Administrator”.
- If it is not, switch to an account with administrator rights or request permission from an administrator.
3. Disable User Account Control (UAC) Temporarily
User Account Control (UAC) settings can prevent commands from executing. To disable it temporarily:
- Press
Win + R
, typeControl Panel
, and press Enter.
- Navigate to User Accounts > Change User Account Control settings.
- Move the slider down to Never notify and click OK.
- Restart your computer and try running the command again.
Note: Re-enable UAC after executing your command to maintain system security.
4. Check File and Folder Permissions
If the error occurs while accessing files or folders, verify and adjust their permissions:
- Right-click on the file or folder and select Properties.
- Navigate to the Security tab.
- Click on Edit and select your user account.
- Ensure you have full control and save the changes.
5. Use an Elevated PowerShell Session
Instead of Command Prompt, you can try running the command in PowerShell:
- Press
Win + X
and select Windows Terminal (Admin) or PowerShell (Admin). - Enter your command and check if it executes correctly.
6. Enable the Built-in Administrator Account
If all else fails, try enabling the built-in Administrator account:
- Open Command Prompt as Administrator.
- Type the following command and press Enter:
net user administrator /active:yes
- Log out and sign in with the Administrator account.
- Run the required command.
- After completing the task, disable the built-in Administrator account for security purposes:
net user administrator /active:no
Final Thoughts
The “System error 5 has occurred. Access is denied.” message is a common Windows issue caused by insufficient permissions. By following the steps outlined in this guide, you should be able to resolve the error and execute your commands successfully. Always ensure your account has administrative privileges, run the command prompt as an administrator, and check file permissions when necessary.
If you continue experiencing issues, consider creating a new administrator account or checking for corrupted system files using the sfc /scannow
command in an elevated Command Prompt.