How to Fix System Error 5 Has Occurred on Command Prompt

If you are trying to run a command in a Command Prompt and you receive an error message stating that “System error 5 has occurred” instead of a message stating that the command was executed successfully, you do not have the right access and/or privileges to run the command you are trying to run. The full error message that Windows users affected by this problem encounter read:

System error 5 has occurred. Access is denied.

This issue is most commonly encountered when trying to run commands that are a tad more intricate and intrusive than usual – commands such as net user commands and commands pertaining to network shares. This problem has been around since the days of Windows 7 and still exists, which is why countless Windows 10 users have also been affected by it.

In almost all cases, the cause of this issue is the fact that the offending command is being run in a Command Prompt that does not have administrative privileges. When the Command Prompt is telling the affected user that access is denied, it isn’t telling them that their user account does not have administrative privileges – it is telling them that the Command Prompt they are using does not have administrative privileges, which is why the command can’t be run. You see, in order to run some commands, a user account that has administrative privileges isn’t enough – you also need to use a Command Prompt that has been granted administrative privileges.

When most Windows users require the services of a Command Prompt, they simply open the Start Menu, search for cmd and click on the search result titled cmd. However, unfortunately, doing so launches a Command Prompt that does not have administrative privileges, meaning that it does not have the required access to run some commands. To resolve this issue and successfully run the offending command(s), simply run the offending command(s) in an elevated Command Prompt that has administrative privileges. To launch an elevated Command Prompt, you need to:

If you are using Windows 7

  1. Open the Start Menu.
  2. Search for “cmd”.
    Running the Command Prompt
  3. Right-click on the search result titled cmd and click on Run as administrator.
  4. If asked to confirm the action within a popup, confirm the action.

If you are using Windows 8, 8.1 or 10

  1. Press the Windows Logo key + X to open the WinX Menu.
  2. Locate and click on Command Prompt (Admin).
    Running Command Prompt as an administrator
  3. If asked to confirm the action within a popup, confirm the action.

Even though this problem is mostly known to affect the Windows Command Prompt, it is entirely possible for it to affect other similar programs as well. If you are experiencing this issue with another application, simply run the affected application as an administrator and the problem should be resolved.


Kevin Arrows

Kevin Arrows is a highly experienced and knowledgeable technology specialist with over a decade of industry experience. He holds a Microsoft Certified Technology Specialist (MCTS) certification and has a deep passion for staying up-to-date on the latest tech developments. Kevin has written extensively on a wide range of tech-related topics, showcasing his expertise and knowledge in areas such as software development, cybersecurity, and cloud computing. His contributions to the tech field have been widely recognized and respected by his peers, and he is highly regarded for his ability to explain complex technical concepts in a clear and concise manner.